Advanced Statistics - Biology 6030

Bowling Green State University, Fall 2019

Analysis of associations between variables: Multiple Linear Regression Analysis

Multiple Linear Regression Analysis generalizes Linear Regression Analysis to include more than one independent variable. One obtains the best fitting linear, multi-variable equation to account for the existing data and, hopefully, make correct predictions on new data. As such, Multiple linear regression analysis represents a multivariate strategy rather than a bona-fide multivariate technique which is usually reseved for analyses with multiple dependent variables.



How this is done

To perform a stepwise multiple linear regression analysis download datafile "Bodymeasures.txt", then recode variable Sex[M,F] into Sex_num[0,1] and make sure the variable is treated as numeric. You can then create a linear regression model with the variables you want, and display it

> Dataset <- read.table("/BodyMeasures.txt", header=TRUE, sep=",", na.strings="NA", dec=".", strip.white=TRUE)
> Dataset$Sex_num[Dataset$Sex=="M"] <- 0
> Dataset$Sex_num[Dataset$Sex=="F"] <- 1

> Dataset$Sex_num <- as.numeric(Dataset$Sex_num)
> fit <- lm(Sex_num~Mass+Fore+Head,data=Dataset)
> fit

Load library MASS (which is likely already pre-installed on your system), perform stepwise model selection by exact AIC, and display the results

> library(MASS)
> step <- stepAIC(fit, direction="both")
> step$anova

last modified: 2/19/13
This material is copyrighted and MAY NOT be used for commercial purposes, 2001-2019 lobsterman.
[ Advanced Statistics Course page | About BIO 6030 | Announcements ]
[ Course syllabus | Exams & Grading | Glossary | Evaluations | Links ]