[R] Multinomial Logit Model with lots of Dummy Variables

From: ghpow1 <ghpow1_at_student.monash.edu.au>
Date: Sun, 10 Apr 2011 02:37:34 -0700 (PDT)

Hi All,

I am attempting to build a Multinomial Logit model with dummy variables of the following form:

Dependent Variable : 0-8 Discrete Choices

Dummy Variable 1: 965 dummy varsghpow_at_student.monash.edu.augh_at_gp1.com Dummy Variable 2: 805 dummy vars

The data set I am using has the dummy columns pre-created, so it's a table of 72,381 rows and 1770 columns.

The first 965 columns represent the dummy columns for Variable 1 The next 805 columns represent the dummy columns for Variable 2

My code to build the mlogit model looks like the following. I want to know...is there a better way of doing this without these huge equations? (I probably also need a more powerful PC to do all of this).

I'll also want to perform a joint test of significance on the first 805 coefficients...

Is this possible?




#install MLOGIT


#load mydata

mydata = 0
mydata<-read.csv(file="G:\\data.csv",head=TRUE) my_data=0



for(i in 1:num.rows) {





#convert matrix to data.frame
# convert to data frame


#check data frame headers


#load dataframe into mldata with choice variable
mldata<-mlogit.data(my_data_frame, varying=NULL, choice="V1771", shape="wide")

#V1771 = dependent var
#V1-V965 = variable 1 dummies
#V966-V1700 = variable 2 dummies

#regress V1771 against all 1700 variables...
mlogit.model<-mlogit(V1771~0|V1+V2+V3...+V1700,data=mldata, reflevel="0")


View this message in context: http://r.789695.n4.nabble.com/Multinomial-Logit-Model-with-lots-of-Dummy-Variables-tp3439492p3439492.html
Sent from the R help mailing list archive at Nabble.com.

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Sun 10 Apr 2011 - 12:09:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 10 Apr 2011 - 15:10:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive