Database Reference
In-Depth Information
but unknown coefficient 95% of the time. As expected from the earlier t -test
results, none of these confidence intervals straddles zero.
Confidence Interval on the Expected Outcome
In addition to obtaining confidence intervals on the model parameters, it is often
desirable to obtain a confidence interval on the expected outcome. In the Income
example, the fitted linear regression provides the expected income for a given
Age and Education . However, that particular point estimate does not provide
information on the amount of uncertainty in that estimate. Using the predict()
function in R, a confidence interval on the expected outcome can be obtained for a
given set of input variable values.
In this illustration, a data frame is built containing a specific age and education
value. Using this set of input variable values, the predict() function provides a
95% confidence interval on the expected Income for a 41-year-old person with 12
years of education.
Age <- 41
Education <- 12
new_pt <- data.frame(Age, Education)
conf_int_pt <-
predict(results2,new_pt,level=.95,interval="confidence")
conf_int_pt
fit lwr upr
1 68.69884 67.83102 69.56667
For this set of input values, the expected income is $68,699 with a 95% confidence
interval of ($67,831, $69,567).
Prediction Interval on a Particular Outcome
The previous confidence interval was relatively close (+/- approximately $900)
to the fitted value. However, this confidence interval should not be considered
as representing the uncertainty in estimating a particular person's income. The
predict() function in R also provides the ability to calculate upper and lower
bounds on a particular outcome. Such bounds provide what are referred to as
prediction
intervals. Returning to the Income example, in R the 95%
Search WWH ::




Custom Search