Unformatted text preview:

IES 612/STA 4-573/STA 4-576Spring 2006Week 02 – IES612-lecture-week02.docUPDATED: 08 Jan. 2006Using SAS …Check out www.muohio.edu/quantapps for links to SAS helpConfidence Interval for 1  b1t/ 2,n 2SE(b1)Example: Manatee data – 90% CI for the SLOPE90% CI => =0.10 => =0.05 => t.05,12 = 1.782n=14 => n-2 = 12SE(b1) = 0.0129b1 = 0.1250.125  (1.782)(0.129)0.125  0.0230.102 < 1 < 0.148Could use SAS to do this calculation/* tconfint.sas – ‘tinv’/‘quantile’ (v 8/9) function*/options ls=80;data myci; b1 = 0.12486; * slope estimate; SE = 0.01290; * Std. Error of b1;* Tcrit = quantile(‘T’,.95,12);* Pr(T(12) < Tcrit) = 0.95; Tcrit = tinv(.95,12); /* Comment: Area LEFT of Tcrit = .9507:05 Monday, January 14, 2019 1Area RIGHT of Tcrit = .05 */ ME = Tcrit*SE; LCL = b1 - ME; UCL = b1 + ME;proc print; run;from PROC PRINT results in the SAS LISTING fileObs b1 SE Tcrit ME LCL UCL 1 0.12486 0.0129 1.78229 0.022992 0.10187 0.14785F Test of 1H0: 1 = 0Ha: 1 ≠ 0TS: Fobs = [SS(Reg)/1] / [SS(Resid)/(n-2)]RR: Reject H0 if Fobs > F, 1, n-2ConclusionsWhereSS(Re g) ˆ y i y  2i1nSS(Re sid)  yiˆ y i 2i1nFROM SAS OUTPUT …07:05 Monday, January 14, 2019 2Analysis of VarianceSource DFSum ofSquaresMeanSquare F Value Pr > FModel1 1711.97866 1711.97866 93.61 <.0001Error12 219.44991 18.28749Corrected Total13 1931.42857Fobs = 93.61 with associated P-value <0.0001SS(Reg) = 1711.97866 and SS(Resid) = 219.4491s2 = MSE = 18.28749Thoughts about the ingredients of an ANOVA table.1. ANOVA = ANalysis Of VAriance2. “Sum of Squares” represents a partitioning of the TOTAL variation into variability “explained” by a model (the linear regression model here) and the variability NOT explained (residual error)3. SS(Total) [Corrected Total SS= 1931.43 above] is “partitioned” into the SS(Regression) [Model SS =1711.98 above] and SS(Residual) [Error SS = 219.45].4. Mean Squares (MS) are defined as SS/(degrees of freedom).5. A good regression model will have SS(Regression) > SS(Residual) which often translates into a large value of Fobs. 6. Alternative interpretation: SS(Residual) = error in predicting response “y” when using the linear regression model. SS(Total) = error in predicting response “y” when using YBAR. SS(Regression) = SS(Total) - SS(Residual) measures how much better the YHAT prediction model is when compared to YBAR. (more to come later)Alternatively, T Test of 107:05 Monday, January 14, 2019 3H0: 1 = 0Ha: 1 ≠ 0 [some assoc.] Ha: 1 <0 [negative assoc.] Ha: 1 >0 [positive association]TS: tobsb1 0s/ SXXRR: Reject H0 if |tobs | > t, n-2 tobs < -t, n-2 tobs > t, n-2Conclusions: Reject/Fail-to-reject H0?P-value:P(tn-2> |tobs|) P(tn-2< tobs) P(tn-2> tobs)* take a look at the Manatee example from SAS output Parameter EstimatesVariable DFParameterEstimateStandardError t Value Pr > |t|Intercept1 -41.43044 7.41222 -5.59 0.0001nboats1 0.12486 0.01290 9.68 <.0001H0: 1 = 0Ha: 1 ≠ 0 [some assoc.]TS: tobsb1 0s/ SXX= 0.12486/0.01290 = 9.68P-value < 0.0001Decision/Conclusion: REJECT H0 and conclude that there is a linear relationship between the number of manatees killed and the number of boats registered in Florida.Comments: Always write your conclusions in the words of the problem. Translate the symbol representation back to the real world.A confidence interval demonstrates the magnitude of the linear effect. Tests and Confidence intervals are related. For example, if a 100(1-)% confidence interval for a parameter, say 1, does NOT contain 0 (e.g. 0.102 < 1 < 07:05 Monday, January 14, 2019 40.148), then you would reject H0: 1 = 0 in favor of Ha: 1 ≠ 0 at significance level . /* tPvalue.sas*/options ls=80;data myci; b1 = 0.12486; * slope estimate; SE = 0.01290; * Std. Error of b1; tcalc = 9.68; * t statistic value; df = 12; P_lower = probt(tcalc, df); P_upper = 1-probt(tcalc, df); P_two_tail = 2*(1-probt(abs(tcalc),df));* Note: SAS version 9 uses 'CDF' as a generalization of 'probt';proc print; runfrom PROC PRINT results in the SAS LISTING fileObs b1 SE tcalc df P_lower P_upper P_two_tail 1 0.12486 0.0129 9.68 12 1.00000 .000000254 .000000508* Hypothesis tests / Confidence intervals for the intercept, 0, are similar.* SE(b1) SSXXSxi x  2SE(b0) S1nx 2xi x  2* Can you select design points to have more precision when estimating the slope?Remedial Measures and Transformations07:05 Monday, January 14, 2019 5RECALL: Basic ModelYi = 0 +1Xi + i [“simple linear regression”]Y = response variable (dependent variable)X = predictor variable (independent variable, covariate)Formal assumptions:1. relation linear – on average error = 0 [ E(i) = 0 ] –> E(Yi) = 0 +1Xi2. Constant variance - V(i) = 2–> V(Yi) =23. i independent4. i ~ NormalWe will talk more about model adequacy. Now, a few remarks about a special case when the first assumption might be violatedThere may be times when a nonlinear relationship might be modeled by linear regression.Example: MPH and Vehicle Density on a Connecticut Highway07:05 Monday, January 14, 2019 6Plot of MPH vs. Vehicle Density on a CT highway0510152025303540450 20 40 60 80 100 120 140 160Vehicle Density (Vehicles/mile)Average Speed (MPH)Series1What if we plot the Log(MPH) vs. Vehicle Density?07:05 Monday, January 14, 2019 7Plot of Log10(MPH) vs. Vehicle Density on a CT Highway00.20.40.60.811.21.41.61.80 20 40 60 80 100 120 140 160Density (Vehicles per mile)Log10(Average MPH)Series1Ref: http://lib.stat.cmu.edu/DASL/Datafiles/transformationdat.html andB.D. Greenshields and F.M. Weida, Statistics with Applications to Highway Traffic Analysis, Eno Foundation, 1978, 129-131. (DENS, MPH below)* other common examples– exponential growth and decay* LOG10 transformations are also commonly used when the range of the response or predictor variables span many orders of magnitude (e.g. per capita gnp, population size, geographic area).Other Inference in Regression – Average responses or prediction of new observations at a


View Full Document

MIAMI IES 612 - Lecture Notes

Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?