search for: ind4

Displaying 12 results from an estimated 12 matches for "ind4".

Did you mean: ind
2011 Mar 10
2
within group sequential subtraction
...uld like to do sequential subtractions within a group so that I know the time between separate observations for a group of individuals. My data: data <- structure(list(group = c("IND1", "IND1", "IND2", "IND2", "IND2", "IND3", "IND4", "IND5", "IND6", "IND6"), date_obs = structure(c(6468, 7063, 9981, 14186, 14372, 5129, 9767, 11168, 10243, 10647), class = "Date")), .Names = c("group", "date_obs"), row.names = c(NA, 10L), class = "data.frame") So I st...
2009 Feb 13
0
lists on a script
...&!(x[i+12,j]==0)){cont<-i; break} else cont<-i }; if (cont>92) {ind3<-c(ind3,j); foo[[j]]<-NULL;next} else { año<-floor(cont/12); mes<-(cont-12*año); a<-(1999+año); foo[[j]]<-ts(x[(cont):nrow(x),j],frequency=12,start=c(a,mes))}}; That's the first part, then ind4<-integer(); for (m in setdiff(diff,ind3)){ nn<-length(foo[[m]]); prinf<-median(foo[[m]][1:12]); prsup<-median(foo[[m]][(nn-12):nn]); if (xor((prsup/prinf)>s,(prinf/prsup)>s)) {ind4<-c(ind4,m)}}; crit3<<-ind4; So far so good (aparently). I mean, the "crit3&qu...
2009 Sep 11
2
Accumulating results from "for" loop in a list/array
...(rep("n",7),rep("y",3)), d = c("y", rep("n",4), rep("y",2), rep("n",3))) for (i in 1:(dim(x)[2])) { assign(paste("ind", i, sep = ""), which(x[ , i] == "y")) accum <- c(ind1, ind2, ind3, ind4) } > ind1 [1] 4 5 9 10 > ind2 [1] 1 2 7 8 9 > ind3 [1] 8 9 10 > ind4 [1] 1 6 7 > accum [1] 4 5 9 10 1 2 7 8 9 8 9 10 1 6 7 Are there any alternative method where the highlighted statement above can be represented without typing individual objects manually? (as it...
2011 Dec 05
1
Subsetting a data frame
...h subsetting data frames: I have a large database of medical records and I want to be able to match patterns from a list of search terms . I've used this simplified data frame in a previous example: db <- structure(list(ind = c("ind1", "ind2", "ind3", "ind4"), test1 = c(1, 2, 1.3, 3), test2 = c(56L, 27L, 58L, 2L), test3 = c(1.1, 28, 9, 1.2)), .Names = c("ind", "test1", "test2", "test3"), class = "data.frame", row.names = c(NA, -4L)) terms_include <- c("1","2","3&qu...
2011 Aug 10
2
choosing selective data with permutations
Hello, I am a R beginner and hoping to obtain some hints or suggestions about using permutations to sort a data set I have. Here is an example dataset: Ind1 11 00 12 15 28 Ind2 21 33 22 67 52 Ind3 22 45 21 22 56 Ind4 11 25 74 77 42 Ind5 41 32 67 45 22 This will be read into a variable using read.table. What I want to do is permute these individuals and every time pick 3 individuals and write them to a new variable. I want to do this 100 times so that in the end I will have 100 tables containing...
2009 Aug 09
1
problem adding columns to matrix
...86 28.32586 >rownames(m)<-paste("ind", 1:4, sep="") > > > m size head pectoral area weight ind1 27.32586 28.32586 29.32586 27.32586 28.32586 ind2 28.32586 29.32586 27.32586 28.32586 29.32586 ind3 29.32586 27.32586 28.32586 29.32586 27.32586 ind4 27.32586 28.32586 29.32586 27.32586 28.32586 > s<-factor(c("m","m","f","f")) > > > s [1] m m f f Levels: f m > cbind(m,s) size head pectoral area weight s ind1 27.32586 28.32586 29.32586 27.32586 28.32586 2 ind2 28.3...
2011 Oct 05
2
Subsetting a data frame with multiple values and exclusions.
...that the convention is to provide a working example of my problem but the data are of a sensitive nature so I'm not able to do that in this case. I need to query a database for multiple search terms: db <- structure(list(ind = c("ind1", "ind2", "ind3", "ind4"), test1 = c(1, 2, 1.3, 3), test2 = c(56L, 27L, 58L, 2L), test3 = c(1.1, 28, 9, 1.2)), .Names = c("ind", "test1", "test2", "test3"), class = "data.frame", row.names = c(NA, -4L)) terms_include <- c("1","2","3&quo...
2011 Mar 09
2
Cleaning date columns
Hi Everyone, I have the following problem: data <- structure(list(prochi = c("IND1", "IND1", "IND1", "IND2", "IND2", "IND2", "IND2", "IND3", "IND4", "IND5"), date_admission = structure(c(6468, 6470, 7063, 9981, 9983, 14186, 14372, 5129, 9767, 11168), class = "Date")), .Names = c("prochi", "date_admission"), row.names = c("27", "28", "21", "86", "77&quo...
2008 Oct 29
1
Subsetting data in a loop
...ong. Thanks, Tim     one_year<-list() for (i in min(mydat$Year):max(mydat$Year)) #Loops from first to last year in dataset { myear<-mydat[mydat$Year==i,] name<-paste("Year",i) one_year[name]<-myear }     mydat: Year Month Day          number other   Ind1      Ind2       Ind3   Ind4 1985     8  13             1     1       0         0          0      0 1986     8   5             2     3       0         0          0      0 1991     4  24             3     0       0         0          0      0 1991     4  25             4     0       0         0          0      0 1991     8   2 ...
2005 Jul 25
0
lda: scaling to 'disctiminant function'
...v") Ind <- cbind(EW$AGR, EW$MIN, EW$MAN, EW$PS, EW$CON, EW$SER, EW$FIN, EW$SPS, EW$TC) Dep <- EW$GROUP LDA <- lda(Dep ~ Ind, prior=c(1,1,1)/3) So far so good. I have.... > LDA$scaling LD1 LD2 Ind1 1.3415788 3.689959 Ind2 1.5118460 5.215123 Ind3 1.4480197 3.653298 Ind4 2.1898063 3.875867 Ind5 1.2055849 3.913750 Ind6 0.8257858 3.718032 Ind7 1.3481728 3.699259 Ind8 1.2364320 3.871438 Ind9 2.0652630 2.891655 What do I do with this to convert it to the coefficients for the discrimination functions? cheers Worik
2017 Nov 18
0
Using cforest on a hierarchically structured dataset
...7?? 50?? ... ???????????????? 0.01???????? ind5??????? S2?? 15 7?? 50?? ... ...?????????????????????????????????????? S2?? 15 7?? 50?? ... ????????????????? 0.4???????? ind1??????? S3??? 2 8??? 5?? ... ???????????????? 0.05???????? ind3??????? S3??? 2 8??? 5?? ... ????????????????? 0.1???????? ind4??????? S3??? 2 8??? 5?? ... ????????????????? 0.2???????? ind5??????? S3??? 2 8??? 5?? ... ...?????????????????????????????????????? S3??? 2 8??? 5?? ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...?? ... If I run a classical cforest on this dataset, explaining Y_behaviour_frequen...
2009 Sep 11
3
For sending my R package as part of R-project
...(rep("n",7),rep("y",3)), d = c("y", rep("n",4), rep("y",2), rep("n",3))) for (i in 1:(dim(x)[2])) { assign(paste("ind", i, sep = ""), which(x[ , i] == "y")) accum <- c(ind1, ind2, ind3, ind4) } > ind1 [1] 4 5 9 10 > ind2 [1] 1 2 7 8 9 > ind3 [1] 8 9 10 > ind4 [1] 1 6 7 > accum [1] 4 5 9 10 1 2 7 8 9 8 9 10 1 6 7 Are there any alternative method where the highlighted statement above can be represented without typing individual objects manually? (as it...