Cheat&Sheet:&Linear&Regression&
Measurement&and&Evaluation&of&HCC&Systems&
&
Scenario)
Use®ression&if&you&want&to&test&the&simultaneous&linear&effect&of&several&variables&varX1,&
varX2,&…&on&a&continuous&outcome&variable&varY.&In&this&scenario,&you&are&predicting&varY&with&
varX1,&varX2,&….
Power)analysis)for)linear)regression)
- There&are&several&versions&of&power&analysis&for&linear®ression,&but&the&most&versatile&one&
is&“F&tests”,&“Linear&multiple®ression:&Fixed&model,&R2&increase”.&
- A&power&analysis&has&four&variables:&Effect&size,&
α
$(usually&.05),&power&(usually&.85),&and&N.&If&
you&know&three&of&these,&G*Power&will&calculate&the&fourth.&Select&the&correct&type&of&power&
analysis,&based&on&the&information&you&have,&and&what&you&want&to&find&out.&
- “Number&of&tested&predictors”&is&the&number&of&Xs&that&you&want&to&test&simultaneously.&
Often&you&want&to&test&the&effect&of&an&individual&X,&in&which&case&this&field&should&say&1.&
- “Total&number&of&predictors”&is&the&total&number&of&Xs&in&the&model.&
- By&clicking&on&“Determine”,&you&can&compute&the&effect&size&f2&from&the&partial&R2.&This&is&the&
increase&in&R2&caused&by&the&predictors&you&want&to&test.&
- Click&on&“Calculate”&to&calculate&the&missing¶meter.&
Plotting)scatterplots)with)linear)trend)line)
- Use&the&ggplot2&package&to&plot&a&scatterplot&with&a&linear&trend&line.&
ggplot(data, aes(varX1, varY)) + geom_point() + geom_smooth(method=”lm”,
color=”red”, se=F)&&
- (optional)&To&add&a&mean&line,&add:&
+ geom_line(aes(y = mean(data$varY)), color=“blue”&&
- Visually&inspect&if&the&relationship&is&indeed&a&linear&one&(see&assumptions).&You&can&also&
check&if&the&scatterplot&has&a&funnel&shape,&which&may&suggest&heteroscedasticity&(see&
assumptions).&Repeat&this&procedure&for&varX2,&etc.&