Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Re: Binary Logistic Regression
Replies: 1   Last Post: Apr 8, 2013 9:47 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Guest

Watch Watch this User
Re: Binary Logistic Regression
Posted: Apr 8, 2013 8:11 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hey Phoebe!
I am getting the same problem. Did you get the correct solution now? Please share.


"Phoebe " <phoebe_62@hotmail.co.uk> wrote in message <k1ij0v$5gt$1@newscl01ah.mathworks.com>...
> Trying to perform binary logistic regression with one y and 3 x's. Code is as follows so far;
> clear
> x1=[....];
> x2=[....];
> x3=[....];
> xfull=[x1 x2 x3];
> y=[0 1 0 ...etc];
> [bfull,devfull]=glmfit(xfull,y,'binomial','link','logit');
> n1=sum(y);
> n=size(y,1);
> n0=n-n1;
> G=-2*(n1*log(n1)+n0*log(n0)-n*log(n) - dev);
> pval=1 - chi2cdf(G,3)
> bfull
> devfull
> n1
> n
> n0
> G
> pval
>
> I have a few queries;
> 1. Matlab says my y must be a 2 column matrix or a vector which it is inputted as so i dont know why it doesnt recognise this?
> 2. Within the pval equation it refers to (G,3) although in some cases this number is a 1 not a 3?




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.