Yoo Jinho
2012-Jan-05 01:10 UTC
[R] difference of the multinomial logistic regression results between multinom() function in R and SPSS
Dear all, I have found some difference of the results between multinom() function in R and multinomial logistic regression in SPSS software. The input data, model and parameters are below: choles <- c(94, 158, 133, 164, 162, 182, 140, 157, 146, 182); sbp <- c(105, 121, 128, 149, 132, 103, 97, 128, 114, 129); case <- c(1, 3, 3, 2, 1, 2, 3, 1, 2, 2); result <- multinom(case ~ choles + sbp + choles:sbp, abstol=1.0e-20, reltol=1.0e-20, MaxNWts=10000); However, the estimated coeffcients and standard errors of the coefficeints are different from the SPSS. For instance, the estimated coefficients of the variable "choles" are 0.1946555 and 0.6244513 from the above result, but the SPSS result are 0.213120 and 0.662575. Standard errors are much more different. Why these kind of discrepancies occur? I'll be very appreciated to whom explain the above matter. Thanks. Jinho Yoo. [[alternative HTML version deleted]]
David Winsemius
2012-Jan-05 01:48 UTC
[R] difference of the multinomial logistic regression results between multinom() function in R and SPSS
On Jan 4, 2012, at 8:10 PM, Yoo Jinho wrote:> Dear all, > > I have found some difference of the results between multinom() > function in > R and multinomial logistic regression in SPSS software. > > The input data, model and parameters are below: > > choles <- c(94, 158, 133, 164, 162, 182, 140, 157, 146, 182); > sbp <- c(105, 121, 128, 149, 132, 103, 97, 128, 114, 129); > case <- c(1, 3, 3, 2, 1, 2, 3, 1, 2, 2); > > result <- multinom(case ~ choles + sbp + choles:sbp, abstol=1.0e-20, > reltol=1.0e-20, MaxNWts=10000); > > However, the estimated coeffcients and standard errors of the > coefficeints > are different from the SPSS. > > For instance, > > the estimated coefficients of the variable "choles" are 0.1946555 and > 0.6244513 from the above result, but the SPSS result are 0.213120 and > 0.662575. > > Standard errors are much more different. > > Why these kind of discrepancies occur?I was taught as a fundamental priciple that interpretation of coefficients could not be done until you have both the data and the internal coding. You have provided only half of those requirements. So back to you. -- David Winsemius, MD West Hartford, CT
peter dalgaard
2012-Jan-05 08:58 UTC
[R] difference of the multinomial logistic regression results between multinom() function in R and SPSS
On Jan 5, 2012, at 02:10 , Yoo Jinho wrote:> Dear all, > > I have found some difference of the results between multinom() function in > R and multinomial logistic regression in SPSS software. > > The input data, model and parameters are below: > > choles <- c(94, 158, 133, 164, 162, 182, 140, 157, 146, 182); > sbp <- c(105, 121, 128, 149, 132, 103, 97, 128, 114, 129); > case <- c(1, 3, 3, 2, 1, 2, 3, 1, 2, 2); > > result <- multinom(case ~ choles + sbp + choles:sbp, abstol=1.0e-20, > reltol=1.0e-20, MaxNWts=10000); > > However, the estimated coeffcients and standard errors of the coefficeints > are different from the SPSS. > > For instance, > > the estimated coefficients of the variable "choles" are 0.1946555 and > 0.6244513 from the above result, but the SPSS result are 0.213120 and > 0.662575. > > Standard errors are much more different. > > Why these kind of discrepancies occur?Usually because the parametrizations differ and/or one of the programs (not always R) has convergence problems. In the present case, I suspect that you missed the point in ?multinom about scaling variables on the rhs.> colSums(fitted(result))1 2 3 2.999702 4.001649 2.998649 suggests that convergence accuracy is not the greatest (the likelihood equations should set these equal to the observed counts: 3-4-3). Also notice that the interaction means that the interpretation of coefficients for choles are that they are effects for sbp==0, way outside of your data, so smaller discrepancies may be getting multiplied. Fuller output from SPSS is needed to say anything more. Is the deviance smaller, e.g.? -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com