search for: mldata

Displaying 8 results from an estimated 8 matches for "mldata".

Did you mean: medata
2003 Nov 08
2
help with hierarchical clustering
I have a large excel file with data in it. I converted it to a 'csv' format. I imported this dataset to R using the follownig command mldata <- read.csv("c:\\temp\\mldata.csv", header=T) all the column names and the rows seems to be correct. Now that I have this object, I need to perfrom hclust. I used the following hc <- hclust(dist(mldata), method="single") I get the following error > hc <- hc...
2011 May 25
1
Multinomial Logistical Model
On May 24, 2011; 11:06pm Belle wrote: > Does anyone know how to run Multinomial logistical Model in R in order to > get predicted probability? Yes. I could stop there but you shouldn't. The author of the package provides plenty of examples (and two good vignettes) showing you how to do this. Suggest you do some work in that area. Look especially at how model formulas are
2010 Mar 07
3
mlogit
...mod > > mydata[1:10,] brand female age 1 1 0 24 2 1 0 26 3 1 0 26 4 1 1 27 5 1 1 27 6 3 1 27 7 1 0 27 8 1 0 27 9 1 1 27 10 1 0 27 > mydata$brand<-as.factor(mydata$brand) > mldata<-mlogit.data(mydata, varying=NULL, choice="brand", shape="wide") > > mldata[1:10,] brand female age 1.1 TRUE 0 24 1.2 FALSE 0 24 1.3 FALSE 0 24 2.1 TRUE 0 26 2.2 FALSE 0 26 2.3 FALSE 0 26 3.1 TRUE 0 26 3.2 FALSE 0...
2011 Apr 10
2
Multinomial Logit Model with lots of Dummy Variables
...s) for(i in 1:num.rows) { nb=mydata[i,2] np=mydata[i,3] my_data[i,nb]=1 my_data[i,965+np]=1 my_data[i,1+1770]=mydata[i,1] } #convert matrix to data.frame # convert to data frame my_data_frame<-as.data.frame(my_data) #check data frame headers head(my_data_frame) #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......
2011 Aug 12
0
Mixed Logit model mlogit error
...tives assumption and now I would like to run a mixed logit model. It is a "wide" data set with 9 independent (individual) variables and three choices (variable Y). The database is in a cvs file called CAU. This is the code I have run successfully up to now. CAU$Y<- as.factor(CAU$Y) mldata<-mlogit.data(CAU, varying=NULL, choice="Y", shape="wide") mlogit.model<-mlogit(Y~1|Gender+Age+Net+CompT+Hrs+Motivado+Visits+StudyT+HrsVis,data=mldata,reflevel="1") I am having problems running the mixed logit model. I have changed (only) the mlogit command, as...
2011 Apr 29
0
mlogit package, "Error in X[omitlines, ] <- NA : subscript out of bounds"
...et a data problem, for which I can't find any clue from R archive. code below shows my related code all the way to the error #--------------------------------------------------------------------------- mydata <- data.frame(dependent,x,y,z) mydata$dependent<-as.factor(mydata$dependent) mldata<-mlogit.data(mydata, varying=NULL, choice="dependent", shape="wide") summary(mlogit.1<- mlogit(dependent~1|x+y+z, data = mldata, reflevel="0")) "Error in X[omitlines, ] <- NA : subscript out of bounds" , #-------------------------------------------...
2012 Mar 15
0
Logistic Regression Coding Help
...ata.txt", header=T, as.is=T) #"bullsharks" is what I named it bullsharks$Obs bullsharks$Density bullsharks$Visibility bullsharks$Behavior bullsharks$Data #or to view all data bullsharks library(mlogit) bullsharks[1:2,] bullsharks$Density<-as.factor(bullsharks$Density) mldata<-mlogit.data(bullsharks, varying=NULL, choice="Density", shape="wide") mlogit.model <- mlogit(Density~1|Visibility+Behavior, data = mldata, reflevel="1") summary(mlogit.model) However, I get an error at the mlogit.model stage.  Is there something wrong with m...
2020 Sep 21
2
Help with the Error Message in R "Error in 1:nchid : result would be too long a vector"
...individual and for each individual I have *9 questions*. I have a response from *516 individuals*. So it is a panel of 9*516 observations. I have arranged the data in long format (it contains 100 columns indicating different variables and identifiers). In mlogit I tried the following command--- *mldata<- mlogit.data(mydata, shape = "long", alt.var = "Alt_name", choice = "Choice_binary", id.var = "IND")* It is giving me the following error message- Error in 1:nchid : result would be too long a vector Could you please help me with this? I don't think...