search for: catvar

Displaying 3 results from an estimated 3 matches for "catvar".

2003 Jan 29
3
multinomial conditional logit models
...case must be identified by a strata variable (id) * Each duplicate must be identified by a variable indexing the choices (newy) * A dichotomous variable must indicate which duplicate corresponds with the respondent's choice (didep) I've done this as follows: mclgen <- function (datamat,catvar) { ncat <- nlevels(catvar) id<-1:length(catvar) datamat<-cbind(id,datamat) perschoice <-NULL for (i in 1:ncat) { perschoice<-rbind(perschoice,datamat) } perschoice<-perschoice[sort.list(perschoice$id),] perschoice$newy<-gl(ncat,1,length=nrow(perschoice)) dep<-pars...
2011 Nov 19
3
Data analysis: normal approximation for binomial
Dear R experts, I am trying to analyze data from an article, the data looks like this Patient Age Sex Aura preCSM preFreq preIntensity postFreq postIntensity postOutcome 1 47 F A 4 6 9 2 8 SD 2 40 F A/N 5 8 9 0 0 E 3 49 M N 5 8 9 2 6 SD 4 40 F A 5 3 10 0 0 E 5 42 F N 5 4 9 0 0 E 6 35 F N 5 8 9 12 7 NR 7 38 F A 5 NA 10 2 9 SD 8 44 M A 4 4 10 0 0 E 9 47 M A 4 5 8 2 7 SD 10 53 F A 5 3 10 0 0 E 11
2012 Dec 10
3
use variable in for loop to name output files
Hi, This question should be simple to answer. I am a new R user. I have a data.frame called appended. I would like to break it into 7 smaller datasets based on the value of a categorical variable dp (which has values 1:7). I would like to name the smaller datasets set1, set2, set3,....,set7. I don't know how to refer to the variable in the for loop, when naming the output datasets. In STATA