/* The data we examine are the drug amounts and reaction times */ /* from the example we studied in class */ /* As in class, suppose we want to calculate CIs for mean reaction time */ /* and prediction intervals for reaction time at particular drug amounts. */ /* The options clm and cli will give us CIs for E(Y) and PIs for Y, for the values */ /* of X (the drug amounts) in the data set. */ /* But suppose we were interested in the 95% CI for mean reaction time and 95% prediction */ /* interval for reaction time, for a person who had 3.5 % drug amount. */ /* Note that 3.5 is not among the drug amounts in the data set, so we create a "new" */ /* observation with DRUG_X=3.5 and TIME_Y=. (missing): */ /* Note that I'm giving this data set a new name, PREDSTIM: */ DATA PREDSTIM; INPUT DRUG_X TIME_Y; CARDS; 1 1 2 1 3 2 4 2 5 4 3.5 . ; PROC REG DATA=PREDSTIM; MODEL TIME_Y=DRUG_X /clm cli; RUN; /* Look at the last line of the "Output Statistics". This shows the prediction */ /* for the person with 3.5 % drug amount. We see the predicted */ /* reaction time for this person is 2.35 seconds. The 95% CI for mean reaction time */ /* for all people with 3.5 % drug amount is between 1.44 and 3.26 seconds. */ /* The prediction interval for the reaction time for a new person who has drug */ /* amount 3.5 % is (0.22, 4.48) in seconds. These results match what we saw in class. */