This is the error message:
Error in qt((1 - level)/2, df) : Non-numeric argument to mathematical function
What I am trying to do is to fit a model to check the association between SBP and age with sex and race adjustments.
My code uses the uwIntroStats
package: the code to fit the model works. Sex (male
) is coded as 0 for female and 1 for male, race
is coded 1 to 4.
library(uwIntroStats)
data(mri)
model <- regress("mean", sbp~age*male+as.factor(race), data = mri)
predict(model, data.frame(age=70,male=0,race=2),interval="prediction")
Any reasons why the error occurs and how to fix it? Thanks!