Skip to content
Prev 386755 / 398502 Next

Defining partial list of variables

Thanks Eric. Perhaps I should know when to stop. The approach produces a 
slightly different variable list (note the [[1]]). Consequently, I was 
not able to use xx in defining my regression formula.

 > x<-colnames(subset(mydata,select=c(

+??? hhsize,urban,male,
+??? age3045,age4659,age60, # age1529
+??? highsc,tert,?????????? # primary
+??? gov,nongov,??????????? # unemp
+??? married))); x
 ?[1] "hhsize"? "urban"?? "male"??? "age3045" "age4659" "age60" 
"highsc"? "tert"
 ?[9] "gov"???? "nongov"? "married"
 > xx<-strsplit(gsub("[\n ]","",
+??? "hhsize,urban,male,
+???? age3045,age4659,age60,
+???? highsc,tert,
+???? gov,nongov,
+???? married"
+ ),","); xx
[[1]]
 ?[1] "hhsize"? "urban"?? "male"??? "age3045" "age4659" "age60" 
"highsc"? "tert"
 ?[9] "gov"???? "nongov"? "married"

 > eq1<-my.formula(y="cig",x=x); eq1
cig ~ hhsize + urban + male + age3045 + age4659 + age60 + highsc +
 ??? tert + gov + nongov + married
 > eq2<-my.formula(y="cig",x=xx); eq2
cig ~ c("hhsize", "urban", "male", "age3045", "age4659", "age60",
 ??? "highsc", "tert", "gov", "nongov", "married")
On 2021/1/5 ?? 06:01, Eric Berger wrote: