Hello, I am VERY new to R (one week) and I am trying to run a multinomial logit model. The model I am using is> model1 <- multinom(Y ~ X1 + X2 + , ..., Xn)if I put in> summary(model1)I get #Error in function (classes, fdef, mtable) : unable to find an inherited method for function "fitted", for signature "multinom" and if I put in> coef(model1)I get the coefficients. I would like, however, to get the coefficients, estimates, Std Erros and t-Ratios and/or z or P>[z] Also can you change the speficiation of the base category without recoding? Thanks. Nicole
Hi,
since you are very new to R, just a small advice: try to give a minimal
reproducible, self-contained example. This helps quite often to spot
some mistakes yourself. This is my own experience and has been
experienced by others, see, for example:
library(fortunes)
fortune("Ripleyed")
:-)
For example, mention that you are (probably?) using the package 'nnet'.
nicole baerg wrote:> I get the coefficients. I would like, however, to get the
> coefficients, estimates, Std Erros and t-Ratios and/or z or P>[z]
Check
names(model1) #if model1 is your fitted model as you write
then you will see a list of the components the fitted object should
have. I guess the list should look similar to this:
[1] "n" "nunits" "nconn"
"conn"
[5] "nsunits" "decay" "entropy"
"softmax"
[9] "censored" "value" "wts"
"fitted.values"
[13] "residuals" "lev" "call"
"terms"
[17] "weights" "deviance" "rank"
"coefnames"
[21] "vcoefnames" "contrasts" "xlevels"
"edf"
[25] "AIC"
>
> Also can you change the speficiation of the base category without recoding?
>
Check
?relevel
I hope this helps,
Roland
On Thu, 21 Jun 2007, nicole baerg wrote:> Hello, > > I am VERY new to R (one week) and I am trying to run a multinomial logit model. > The model I am using is > >> model1 <- multinom(Y ~ X1 + X2 + , ..., Xn) > > if I put in > >> summary(model1) > > I get > > #Error in function (classes, fdef, mtable) : > unable to find an inherited method for function "fitted", for > signature "multinom"You have some other package attached (you are using 'nnet' without mention or credit) that has broken summary() (the correct summary method does not use fitted()). The R posting guide asks for the output of sessionInfo(), and that would have helped us here. All I can tell is that the culprit is an S4-using package. Try again with only the smallest possible set of packages attached.> and if I put in > >> coef(model1) > > I get the coefficients. I would like, however, to get the > coefficients, estimates, Std Erros and t-Ratios and/or z or P>[z] > > Also can you change the speficiation of the base category without recoding??contr.treatment ?relevel> Thanks. > > Nicole > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.PLEASE do -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Maybe Matching Threads
- how can I access parts of yags output
- omnibus LR in multinomial model
- does multinomial logistic model from multinom (nnet) has logLik?
- difference of the multinomial logistic regression results between multinom() function in R and SPSS
- multinom() and multinomial() interpretation