Logistic regression: Interpretation of stats
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)
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
Pauli
on 26 Mar 2019
Adam Danz
on 26 Mar 2019
I think it would be helpful to go through the first example provided within the documentation.
The coefficients express both the effects of the predictor variables on the response categories and the log odds of being in one category versus the reference category. The p value is a measure of the significance of the effect. You could have a strong effect (high coeficient values) but not significant (p>0.05) or you could have a weak effect that is highly significant (p<0.001).
Pauli
on 27 Mar 2019
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.
Pauli
on 28 Mar 2019
Categories
Find more on Univariate Discrete Distributions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!