





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






log: /Users/carolbigelow/Desktop/week3.log log type: text opened on: 17 Feb 2009, 11:07:
. * The command SET MORE OFF prevents screen by screen pauses in display of results . set more off . * From the FILE drop down menu, the command OPEN will import the data The following will then appear on your results window for you; I did not actually type it. . use "/Users/carolbigelow/Desktop/1. Teaching/web640/data sets/week03.dta" . * The command DESCRIBE provides a description of the data set structure . describe
Contains data from /Users/carolbigelow/Desktop/1. Teaching/web640/data sets/week03.dta obs: 15 vars: 3 size: 240 (99.9% of memory free)
storage display value variable name type format label variable label
y float %9.0g x1 float %9.0g x2 float %9.0g
Sorted by:
. * The command LABEL VARIABLE allows you to give names to the variables . * Note: Stata requires that you use the command LABEL VARIABLE for each variable. You cannot label multiple * variables with one command. . label variable y "Y: log10(survival)" . label variable x1 "X1: log10(dose)" . label variable x2 "X2: log10(weight)"
These variable labels will appear on your output when you ask for summary statistics. They do Not appear in the output for regression requests. As a matter of good programming, I suggest that you get in the habit of naming your variables using the LABEL VARIABLE command.
. * ------ Analysis of Variance Table for One Predictor Model: x1 ---* . * The command REGRESS fits the model and produces the anova table . regress y x
Source | SS df MS Number of obs = 15 -------------+------------------------------ F( 1, 13) = 31. Model | .363274049 1 .363274049 Prob > F = 0. Residual | .147992891 13 .011384069 R-squared = 0. -------------+------------------------------ Adj R-squared = 0. Total | .51126694 14 .036519067 Root MSE =.
y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x1 | -.5498559 .0973376 -5.65 0.000 -.7601409 -. _cons | 2.952199 .073555 40.14 0.000 2.793293 3.
. * ------ Analysis of Variance Table for One Predictor Model: x2 ---* . regress y x
Source | SS df MS Number of obs = 15 -------------+------------------------------ F( 1, 13) = 25. Model | .336674125 1 .336674125 Prob > F = 0. Residual | .174592816 13 .013430217 R-squared = 0. -------------+------------------------------ Adj R-squared = 0. Total | .51126694 14 .036519067 Root MSE =.
y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x2 | 1.375579 .2747401 5.01 0.000 .7820388 1. _cons | 2.184706 .0819958 26.64 0.000 2.007565 2.
. * ------ Analysis of Variance Table for One Predictor Model: x1 and x2 ---* . regress y x1 x
Source | SS df MS Number of obs = 15 -------------+------------------------------ F( 2, 12) = 59. Model | .46420206 2 .23210103 Prob > F = 0. Residual | .04706488 12 .003922073 R-squared = 0. -------------+------------------------------ Adj R-squared = 0. Total | .51126694 14 .036519067 Root MSE =.
y | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- x1 | -.3784805 .0663741 -5.70 0.000 -.5230972 -. x2 | .8749749 .1724835 5.07 0.000 .4991656 1. _cons | 2.588996 .0836079 30.97 0.000 2.40683 2.
Solution uses output for fit of the X2 alone predictor model:
. regress y x
Source | SS df MS Number of obs = 15 -------------+------------------------------ F( 1, 13) = 25. Model | .336674125 1 .336674125 Prob > F = 0. Residual | .174592816 13 .013430217 R-squared = 0. -------------+------------------------------ Adj R-squared = 0. Total | .51126694 14 .036519067 Root MSE =. Reject Null (P = .0002).Conclude model explains a significant proportion of the total variability in y.
. regress y x1 x
Source | SS df MS Number of obs = 15 -------------+------------------------------ F( 2, 12) = 59. Model | .46420206 2 .23210103 Prob > F = 0. Residual | .04706488 12 .003922073 R-squared = 0. -------------+------------------------------ Adj R-squared = 0. Total | .51126694 14 .036519067 Root MSE =.
regress y x
Source | SS df MS Number of obs = 15 -------------+------------------------------ F( 1, 13) = 31. Model | .363274049 1 .363274049 Prob > F = 0. Residual | .147992891 13 .011384069 R-squared = 0. -------------+------------------------------ Adj R-squared = 0. Total | .51126694 14 .036519067 Root MSE =.
. regress y x
Source | SS df MS Number of obs = 15 -------------+------------------------------ F( 1, 13) = 25. Model | .336674125 1 .336674125 Prob > F = 0. Residual | .174592816 13 .013430217 R-squared = 0. -------------+------------------------------ Adj R-squared = 0. Total | .51126694 14 .036519067 Root MSE =.
Based on the overall F test and size of R 2 , the single predictor model utilizing X 1 is better.