search for: hhtype

Displaying 2 results from an estimated 2 matches for "hhtype".

Did you mean: htype
2010 Mar 01
1
Generating variable from 2 others in dataframe
...=as.vector(sapply(1:5,function(z){a<-rep(0,length(1990:2003));a[sample(1:length(1990:2003),sample(1:2,1))]<-1;a}))) year id eif 1990 1 0 1991 1 0 1992 1 0 2000 1 1 1994 1 0 1995 1 0 2001 1 0 1997 1 1 .... I want to create a new variable in this dataframe called "hhtype" according to the logic: If eif==1, hhtype = 1 Else if year < 2000, hhtype = 2 Else hhtype = 3 The result would be year id eif hhtype 1990 1 0 2 1991 1 0 2 1992 1 0 2 2000 1 1 1 1994 1 0 2 1995 1 0 2 2001 1 0 3 1997 1 1 1 I think I can do this with some combinatio...
2012 Mar 01
1
R can't load a large dataset
Dear R listers, I have a silly problem. I am trying to load a dta (Stata) file in R. The dta is about 650 MB and contains the integrated World Values Survey/ European Value Study data-set. My problem is that I don't manage to load the file. After almost 1 hour I issued the following command: data <- read.dta("http://www.stata-press.com/data/kkd/data1.dta", convert.dates = TRUE,