[R] Trouble with mlogit.data

ablankertz ablankertz at earthlink.net
Wed Dec 7 00:02:34 CET 2011


I've got data in the form of

   rec  policyno reason2 uwclass sexx term band
1    1 17B356313      IS       S    M   30    2
2    2 17B356326      IS       P    M   20    3

when I use > mydata<-mlogit.data(poldata, choice="reason2", shape = "wide",
reflevel="IS")

the result is 

     rec  policyno reason2 uwclass sexx term band chid alt
1.     1 17B356313   FALSE       S    M   30    2    1    
1.DE   1 17B356313   FALSE       S    M   30    2    1  DE
1.IS   1 17B356313    TRUE       S    M   30    2    1  IS
1.NT   1 17B356313   FALSE       S    M   30    2    1  NT
2.     2 17B356326   FALSE       P    M   20    3    2    
2.DE   2 17B356326   FALSE       P    M   20    3    2  DE
2.IS   2 17B356326    TRUE       P    M   20    3    2  IS
2.NT   2 17B356326   FALSE       P    M   20    3    2  NT

I've tried using mydata<-mlogit.data(poldata, choice="reason2", shape =
"tall", alt.levels = c("IS", "DE", "NT"))
but just get an error message.

Any ideas?



--
View this message in context: http://r.789695.n4.nabble.com/Trouble-with-mlogit-data-tp4166866p4166866.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list