search for: reflevel

Displaying 12 results from an estimated 12 matches for "reflevel".

2012 Apr 19
1
mlogit learning error
I am learning five mlogits as follows v1.model<-mlogit(v1~1|v2+v3+v4+v5, data=mlogit.v1.data, reflevel="1") v2.model<-mlogit(v2~1|v1+v3+v4+v5, data=mlogit.v2.data, reflevel="1") v3.model<-mlogit(v3~1|v1+v2+v4+v5, data=mlogit.v3.data, reflevel="1") v4.model<-mlogit(v4~1|v1+v2+v3+v5, data=mlogit.v4.data, reflevel="1") v5.model<-mlogit(v5~1|v1+v2+v3+v...
2011 Mar 13
2
Problem implementing 'waldtest' when using 'mlogit' package
...have run the following command, where mc and mi2 are fitted models: waldtest(mc,mi2) I think that the test is taken from the 'lmtest' package. I get the following error message: Error in terms.default(x) : no terms component The two fitted models are: mc <- mlogit(depvar ~ ic + oc, H, reflevel="hp") mi2 <- mlogit(depvar ~ oc + ic | income, H, reflevel="hp") I would be grateful for tips on how to proceed. Thanks in advance. Best regards, Gaurav S. Ghosh, Ph.D., E.ON Energy Research Centre, Room 01.32, RWTH Aachen, Mathieustraße 6, D-52074 Aachen, Germany [[al...
2010 Dec 15
0
Multinomial Analysis
...uot;." operator in my formula. In addition, it requires me to transform my data frame before running the analysis: > library(mlogit) > data1 <- mlogit.data(data0, varying = NULL, choice = "y", shape = "wide") > summary(mod1 <- mlogit(y ~ 1 | ., data = data1, reflevel = "A")) Error in terms.formula(object) : '.' in formula and no 'data' argument > form2 <- paste("y", " ~ 1 | ", paste(names(data0)[-1], sep = "", + collapse = " + "), sep = "", collapse = "") > sum...
2011 Aug 12
0
Mixed Logit model mlogit error
...se 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 follows mlogit.model<-mlogit(Y~1|Gender+Age+Net+CompT+Hrs+Motivado+Visits+StudyT+HrsVis, data=mldata,reflevel="1",rpar=c(Gender="u",Age="u",Lower=&quo...
2010 Feb 10
0
mlogit: Error reported using sample dataset
...my data I've done the following: xx <- fwc # copies and protects original data.frame xx$VegType <- as.factor(xx$VegType) xx.dat <- mlogit.data(xx, varying = "NULL", choice = "VegType", shape = "wide") xx.mlogit <- mlogit(VegType ~ TP, data = xx.dat,, reflevel = "1") Error in relevel.factor(attr(mf, "index")[["alt"]], reflevel) : 'ref' must be an existing level Can someone explain why these errors are occuring and what to do about them? Thanks Using R 2.10.1, Windows XP Steve Friedman Ph. D. Spatial Statistic...
2010 Feb 14
1
mlogit function cut off formular
I'm trying to fit a multinominal logistic model using package mlogit. I have 15 independent variables. The code looks like this: m<-mlogit(score~0|f1+f2+f3+f4+f5+f6+f7+f8+f9+f10+f11+f12+f13+f14+f15, data, reflevel="1") And it gives the following error message: Error in parse(text = x) : unexpected ')' in "score ~ 0 + alt:(f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10 + f11 + f12 + )" Obviously, the mlogit function somehow cut off my formula, probably because it is too long...
2010 Mar 07
3
mlogit
...0,] 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 26 3.3 FALSE 0 26 4.1 TRUE 1 27 > mlogit.model<- mlogit(brand~1|female+age, data = mldata, reflevel="1") Error in as.data.frame.default(data) : cannot coerce class "call" into a data.frame > summary(mlogit.model) Error in summary(mlogit.model) : object 'mlogit.model' not found > -- View this message in context: http://n4.nabble.com/mlogit-tp1583698p1583698.h...
2011 Apr 10
2
Multinomial Logit Model with lots of Dummy Variables
...e 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") [/code] -- 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.
2011 Aug 05
1
Main-effect of categorical variables in meta-analysis (metafor)
Dear R-experts! In a meta-analysis (metafor) I would like to assess the effect of two categorical covariates (A & B) whereas they both have 4 levels. Is my understanding correct that this would require to dummy-code (0,1) each level of each covariate (A & B)? However I am interested in the main-effects and the interaction of these two covariates and the dummy-coding would only allow to
2011 Aug 16
1
how to sort the levels of a table
...0" "11" "1010" I am aware of the order function and tried a command of the form mtx[order(row1stsort,row2ndsort),order(col1stsort,col2ndsort)]. Sorting i.e. the levels of observers and the reference works well this way: ## sorted levels generated by the reference choices. refLevels <- unique(input[,ncol(input)])[order( as.numeric(sapply(unique(input[,ncol(input)]), FUN=function(x) sum(as.numeric(unlist(strsplit(x,"")))))), as.numeric(as.vector(unique(input[,ncol(input)]))) )] ## sorted levels generated by the observers choices. obsLevels <- unique(unlist(inpu...
2011 Apr 29
0
mlogit package, "Error in X[omitlines, ] <- NA : subscript out of bounds"
...-------------------------------------------- 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" , #--------------------------------------------------------------------------- Could anybody kindly tip how can I possibly solve this problem? Thank you yong
2012 Mar 15
0
Logistic Regression Coding Help
...#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 my data or with my code?  Thank you and any help would be incredibly appreciated! [[alternative HTML version deleted]]