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

R error, ## Predicted probability of being assigned to RHC rhc$pRhc <- predict(psModel, type = "response") #71

Open
wwh199459 opened this issue Sep 3, 2020 · 2 comments

Comments

@wwh199459
Copy link

rhc$pRhc <- predict(psModel, type = "response")
Error in $<-.data.frame(*tmp*, pRhc, value = c(1100109 = 0.82757271771222, :
replacement has 418 rows, data has 448

@ndevln
Copy link
Contributor

ndevln commented Sep 5, 2020

Hi,

do you want to tell us that the SMD vignette does not build for you? What do you want to do and when does this problem occur? Do you have problems installing the package?

This minimal example works for me:

rhc <- read.csv("http://biostat.mc.vanderbilt.edu/wiki/pub/Main/DataSets/rhc.csv")

rhc$swang1 <- factor(rhc$swang1, levels = c("No RHC", "RHC"))
## Fit model
psModel <- glm(formula = swang1 ~ age + sex + race + edu + income + ninsclas +
                 cat1 + das2d3pc + dnr1 + ca + surv2md1 + aps1 + scoma1 +
                 wtkilo1 + temp1 + meanbp1 + resp1 + hrt1 + pafi1 +
                 paco21 + ph1 + wblc1 + hema1 + sod1 + pot1 + crea1 +
                 bili1 + alb1 + resp + card + neuro + gastr + renal +
                 meta + hema + seps + trauma + ortho + cardiohx + chfhx +
                 dementhx + psychhx + chrpulhx + renalhx + liverhx + gibledhx +
                 malighx + immunhx + transhx + amihx,
               family  = binomial(link = "logit"),
               data    = rhc)
## Predicted probability of being assigned to RHC
rhc$pRhc <- predict(psModel, type = "response")

@wwh199459
Copy link
Author

wwh199459 commented Sep 7, 2020 via email

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