Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

Running an rxLogit() function that may be expected to be equivalent to a glm() and rxGlm() call on the same data may return different results than expected.

In the following simple example, the coefficients returned by glm() and rxGlm() will match but those returned  by rxLogit() may be different.

 myFormula <- as.formula("y ~ x1 + x2 + x3 ")
model <- rxLogit( myFormula, data = sampleData)
modelGLM <- glm(myFormula,family=binomial(logit),data=sampleData)
modelrxGLM <- rxGlm(myFormula,family=binomial(logit), data=sampleData)

The key is to set initialValues = NA in rxLogit().

For rxLogit, initialValues defaults to NULL. From the help for rxLogit: "The initial values will be estimated based on a linear regression. This can speed up convergence significantly in many cases. If the model fails to converge using these values, estimation is automatically re-started using the NA option for the initial values." If NA is used, "Initial values of the parameters are computed by a weighted least squares step". For rxGlm, initialValues defaults to NA.

So if the results from rxLogit are unexpectedly different, it may be that the model does converge with initialValues=NULL and the function returns different results. When running the example with initalValues=NA in the rxLogit(), all results match.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×