I'm trying to educate myself about predictive analytics and am using R to
generate a linear model with the following data.

age     <- c(23,   19,   25,   10,9, 12,   11,8)
steroid <- c(27.1, 22.1, 21.9, 10.7,  7.4, 18.8, 14.7, 5.7)
gpa     <- c( 2.1,  2.9,  2.8,  3.5,  3.2,  3.9,  2.8, 2.6)
sample  <- data.frame(age, steroid, gpa)
fit2    <- lm(steroid~age+gpa)
summary(fit2)
newdata <- data.frame(age=15, gpa=3.2)
predict(fit2, newdata, interval="predict")  # I want the fitted /
predicted value

>From the summary for the linear model, I have information on the
coefficients associated with each predictor. However, I want to go further
and find the predicted probability of information from this data. So for
someone who is 13 and has a GPA of 3.3, what's the predicted probability of
them ranking high on the steroid scale? What about for someone who is age
10? etc.

I understand explanatory modeling and have no problem implementing that in R,
I just have issues with using R to construct meaningful predictive
analytics. If you have any insights on this, feel free to share.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to