[R] Multinomial Logit Regression
Prof Brian Ripley
ripley at stats.ox.ac.uk
Sat Apr 12 16:28:09 CEST 2008
The function in package nnet for 'Multinomial Logit Regression' is called
multinom() and not nnet(). You seem not to have used it, and therein lies
your error.
If you need more help, multinom() is support software for a book (see
library(help=nnet)), and the book has extensive worked examples.
On Sat, 12 Apr 2008, _Fede_ wrote:
> Hi again. I believe that I described the things bad before.
>
> I want to make the analysis with a sample data (train.set) of dataset for
> later see if the predictions adjust to the rest of data non selected with
> the sample train.
>
> Then, of the same form in glm:
>
> library(nnet)
> net <- nnet(response.variable~., data = dataset, subset=train.set)
>
> Or...
>
> z=zelig(response.variable ~., model = "mlogit",data=dataset, subset=train)
>
> But this don't work. I don't know yet if I do the MLR of this way. The
> function multinom from nnet library maybe can help but I don't know how can
> be the sintaxis in my case.
>
> In case it serves as help in glm I do:
>
> z <- glm(response.variable~., data=dataset, subset=train.set,
> family=binomial(link="logit))
>
>
> Thank you.
>
> _Fede_
>
>
>
> _Fede_ wrote:
>>
>> Hi all,
>>
>> I have a dataset with a response variable with three categories (1, 2, 3)
>> and a lot of continuous variables. I'd like to make a MLR with these
>> variables. I've been watching the libraries nnet and zelig for this
>> purpose but I don't understand them well.
>>
>> I use a training sample data to make the MLR.
>>
>> train.set <- sample(1:1000,1000*0.7)
>>
>> I have done this:
>>
>> library(nnet)
>> net <- nnet(response.variable~., data = train.set)
>>
>> Error in terms.formula(formula, data = data) :
>> '.' in formula y there is no 'data' argument
>>
>> library(Zelig)
>> z=zelig(response.variable ~., model = "mlogit",data=train.set)
>>
>> Error in terms.formula(object[[i]], specials = c("id", "tag")) :
>> '.' in formula y there is no 'data' argument
>>
>> What's wrong here? How can I make this in the correct form?
>>
>> Thank you in advance.
>>
>> _Fede_
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Multinomial-Logit-Regression-tp16628196p16648683.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org 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.
>
--
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
More information about the R-help
mailing list