Creating Graphs on Saturn GOPTIONS DEVICE = png HTITLE=2 HTEXT=1.5 GSFMODE = replace; PROC REG DATA=agebp; MODEL sbp = age; PLOT sbp*age; RUN; This will create file sasgraph.png 1. Transfer file to PC (binary mode) 2. Open Word 3. Choose Insert picture from file PROC REG DATA=agebp LP; MODEL sbp = age; PLOT sbp*age; RUN;
Creating Graphs on Saturn GOPTIONS DEVICE = png HTITLE = 2 HTEXT = 1.5 GSFMODE = replace; PROC REG DATA =agebp; MODEL sbp = age; PLOT sbp*age; RUN ; This will create file sasgraph.png Transfer file to PC (binary mode) 2. Open Word 3. Choose Insert picture from file - PowerPoint PPT Presentation
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
This will create file sasgraph.png1. Transfer file to PC (binary mode)2. Open Word3. Choose Insert picture from file
PROC REG DATA=agebp LP; MODEL sbp = age; PLOT sbp*age;RUN;
Multiple Linear Regression
• More than 1 independent variable– See how combinations of several variables are associated
with and can predict the dependent variable. How much of the total variability can be explained?
– Control for confounding (interested in the effect of one variable but want to “adjust” for another variable)
– Explore interactions
PROC REG DATA=datasetname ; MODEL depvar = x1; MODEL depvar = x1 x2; MODEL depvar = x1 x2 x3;RUN;
Question Explored Using Multiple Regression
• How much of the variation in test scores among school districts can be explained by several district characteristics?
• Is calcium intake related to BP independent of age?• Is the relationship between age and BP the same for
men and women.
Reminder
• Y variable is continuous and is normally distributed for each combination of X’s with the same variability
• X variables can be continuous or indicator variables and do not need to be normally distributed
2 Factors
1. Y = 0 + 1X1
2. Y = 0 + 2X2
3. Y = 0 + 1X1 + 2X2
• Do you get the same slope in models 1 and 3
Control for confounding
Both SLR models for each cohort significant
Overall not significant
(negative confounding)
The equation that describes how the mean The equation that describes how the mean value of value of yy is related to is related to xx11, , xx22, . . . , . . . xxpp . .
i = change in mean y corresponding to a 1 unit change in xi considering all other predictors fixed
Implied: The impact of x1 is the same for each of the other values of x2, x3, … xp
Multiple Regression ModelMultiple Regression Model
The equation that describes how the dependent The equation that describes how the dependent variable variable yy is related to the independent is related to the independent variables variables xx11, , xx22, . . . , . . . xxpp and an error term is and an error term is called the called the multiplemultiple regression modelregression model..
yy is estimated (or predicted) value for a set of x’s
^̂
Estimation Estimation
Least Squares CriterionLeast Squares Criterion
Computation of Coefficients ValuesComputation of Coefficients Values
The formulas for the regression The formulas for the regression coefficients coefficients bb00, , bb11, , bb22, . . . , . . . bbp p involve the use of involve the use of matrix algebra. We will use SAS to perform matrix algebra. We will use SAS to perform the calculations.the calculations.
min ( iy yi )2min ( iy yi )2^̂
Find the best multidimensional plane
Testing for Significance: Global Test Testing for Significance: Global Test
Hypotheses Hypotheses
HH00: : 11 = = 2 2 = . . . = = . . . = p p = 0= 0
HHaa: One or more of the parameters: One or more of the parameters
is not equal to zero.is not equal to zero. Test StatisticTest Statistic
where where FF is based on an is based on an FF distribution with distribution with pp d.f. in d.f. in
the numerator and the numerator and nn - - pp - 1 d.f. in the - 1 d.f. in the denominator.denominator.
Testing for Significance: IndividualTesting for Significance: Individual ’s’s
HypothesesHypotheses
HH00: : ii = 0 = 0
HHaa: : ii = 0 = 0 Test StatisticTest Statistic
Rejection RuleRejection Rule
Reject Reject HH00 for small or large for small or large tt
Meaning: Is XMeaning: Is Xii related to Y after taking into related to Y after taking into account all other variables in the modelaccount all other variables in the model
tbs
i
bi
tbs
i
bi
PossibilitiesPossibilities
X1 is related to Y alone but after adjusting for X1 is related to Y alone but after adjusting for X2, then X1 is no longer related to YX2, then X1 is no longer related to Y
X1 is not related to Y alone but after adjusting X1 is not related to Y alone but after adjusting for X2, then X1 is related to Yfor X2, then X1 is related to Y
Relation of X1 with Y1 gets stronger after Relation of X1 with Y1 gets stronger after adjusting for X2adjusting for X2
Relation of X1 with Y gets weaker after Relation of X1 with Y gets weaker after adjusting for X2adjusting for X2