Logistic regression: Interpretation of stats
3 views (last 30 days)
Show older comments
Hi,
I have performed a binary logistic regression with one predictor variable using mnrfit. Now using
[b,dev,stats] = mnrfit(x,y);
and looking at the stats I am wondering how to interpret them. I am pretty new to statistical analysis so this might be a stupid question: Why are there two values for a lot of the measures? Which of the two p-values do I interpret?
Thanks in advance for your tipps!
1 Comment
claudia cardarelli
on 12 Aug 2020
i am using mnrfit for logistic regression where x is matrix 12x200 the vector of x is dummy and y is dicotomic. iI should use other than writing mnrfit(x,y)? because I get very high p values. or maybe I should write the x in some particular way
Answers (1)
Adam Danz
on 26 Mar 2019
Edited: Adam Danz
on 26 Mar 2019
Since the 'model' parameter isn't specified in your call to mnrfit(), I'm assuming your working with nominal responses which is the default model. That matters because the 'Interaction' parameter is not specified and it's default value for nominal models is 'on' (for orginal models it's 'off').
So, since you're working with an interaction term, then your beta coefficients should be a matrix of size [p+1 x k-1] where p is the number of predictors and k is the number of categories. As explained in the documentation (<-- read that), each column corresponds to the estimated intercept and predictor coefficients (in the order) and each row corrsponds to the multinomial categories.
So if you have a column of betas [1; 2; -3; -4], your model would be = 1 + 2X1 - 3X2 - 4X3
The stats output contains data in the same order. For example, stats.p are the p values for each beta value.
For more information of the stats output:
5 Comments
Adam Danz
on 27 Mar 2019
If it starts with 1 0, for example, does matlab take 0 as the reference category?
That's a good question and isn't addressed in the documentation for mnrfit(). You could test it by running the function with your categories starting with 1 and again with 0 to see if the coeficients change. My guess is that the categories are the same as if you were to run findgroups().
Also, which p-value do I interpret then?
The p vals and the rest of the stats always correspond to the the betas in the same order as the output.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!