Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined coefs #4

Open
tgerke opened this issue May 3, 2023 · 3 comments
Open

Undefined coefs #4

tgerke opened this issue May 3, 2023 · 3 comments

Comments

@tgerke
Copy link
Contributor

tgerke commented May 3, 2023

fit_rr <- riskratio(death ~ stage + receptor, data = breastcancer)
summary(fit_rr)

The above block, found in both risks.Rmd and the help file for riskratio provides the following fit.

Coefficients: (3 not defined because of singularities)
               Estimate Std. Error z value Pr(>|z|)    
stageStage I     0.0000     0.0000     NaN      NaN    
stageStage II    0.8989     0.3875   2.320   0.0203 *  
stageStage III   1.8087     0.3783   4.781 1.75e-06 ***

The singularities warning may theoretically be expected, but could be confusing for users. A brief explanation of what's going on here could help; alternatively, we could think of ways to strip the warning from the summary() output if it is indeed the right thing.

@tgerke
Copy link
Contributor Author

tgerke commented May 3, 2023

Same for the associated riskdiff calls.

@tgerke
Copy link
Contributor Author

tgerke commented May 3, 2023

Still thinking out loud here: yes, of course this is the right answer, since the output is providing estimates for n parameters instead of n-1 for a factor. Let's think about how to set a reference term in the actual modeling functions.

@stopsack
Copy link
Owner

Great catch. Indeed, I think these apparent singularities arise because coefficients for variables that are not the exposure are not being calculated by marginal standardization approaches. Agree it would be good to get rid of the warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants