New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Biostatistics Week 14 Notes

by: Kiara Lynch

Biostatistics Week 14 Notes BIO 472

Marketplace > La Salle University > Biology > BIO 472 > Biostatistics Week 14 Notes
Kiara Lynch
La Salle

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

One factor analysis of Covariance
Class Notes
25 ?




Popular in Biostatistics

Popular in Biology

This 17 page Class Notes was uploaded by Kiara Lynch on Saturday May 7, 2016. The Class Notes belongs to BIO 472 at La Salle University taught by in Summer 2015. Since its upload, it has received 16 views. For similar materials see Biostatistics in Biology at La Salle University.


Reviews for Biostatistics Week 14 Notes


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 05/07/16
Week 14 Notes ANOVA Often an Experiment or Observational Study will have more than 2 explanatory variables Ex: response variable: BP, explanatory variables: placebo, drug dose A, drug dose B Assumptions Individuals are independent- not matched or measured more than once Normal distribution for each group Variances among groups are equal Equal sample sizes among groups 2 factor ANOVA- assess 3 null hypotheses at the same time H: all means are equal for all levels in factor 1 H: all means are equal for all levels in factor 2 H: There is not a significant interaction b/w the factors There is a differential response to treatment across factors. Ex: males and females have a different response to treatment Body Size ~ Diet and Gender Mean of males = mean of females Mean of experimental = mean of control No interaction between diet and gender If gender OR treatment are not relevant then do a 1 factor ANOVA If BOTH are significant then do a 2 factor ANOVA Interaction is significant if there is a differential response by treatment Ex: 1 gender was affected by treatment while the other gender was not If interaction term is significant but neither of the variables are significant Ex: Gender is insignificant and diet is insignificant, but interaction is significant because there is a differential response to treatment (ex: males increase but females decrease) If an interaction term is significant – do a Tukey assessment General Procedure Assess assumptions Assess full model Response variable ~ factor 1 + factor 2 + interaction If interaction is significatn (p <.05) then stop Assess interaction, regardless of whether factors are significant or not If interaction is not significant, drop it Response variable ~ factor 1 + factor 2 Assess significance for both factors If one factor is significant and the other is not then drop it R CODE aspen<-read.csv("aspen.csv",header=T) attach(aspen) names(aspen) #response variable : Weight_kg #explanatory factors: #environment, 2 levels: RM= Rich/moist and SD= Sandy/dry #treatment, 4 levels: Control, Fertilizer, Irrigation, Fert. and Irr #8 groups boxplot(Weight_kg~Environment) #skewed to higher values boxplot(Weight_kg~Treatment) #looks like no homogeneity of variance boxplot(Weight_kg~Environment*Treatment) full.aspen<-aov(Weight_kg~Environment*Treatment) summary(full.aspen) two.aspen<-aov(Weight_kg~Environment+Treatment) summary(two.aspen) #treatment was significant but environment was not #treatment had no significance on growth but environment did trt.aspen<-aov(Weight_kg~Treatment) summary(trt.aspen) #p < .05 ---> at least one factor is different TukeyHSD(trt.aspen) #2 groups are significantly different ----------------------------------- marathon<-read.csv("marathon.csv",header=T) attach(marathon) names(marathon) #response variable : Time_Seconds #explanatory factors: Sex and Age boxplot(Time_Seconds~Sex) boxplot(Time_Seconds~Age) boxplot(Time_Seconds~Sex*Age) full.marathon<-aov(Time_Seconds~Sex*Age) summary(full.marathon) #sex is not significant but age is two.marathon<-aov(Time_Seconds~Sex+Age) summary(two.marathon) #age is significant but sex is not trt.marathon<-aov(Time_Seconds~Age) summary(trt.marathon) #p < .05 ---> at least one factor is different TukeyHSD(trt.marathon) #age group twenties-forties is significantly different 4/27 Y1- sex is the same but treatments are different Y2- experiment male is significantly different; differential display Y3- treatment effect is conditional upon sex sim<-read.csv("sim4_2factor.csv",header=T) attach(sim) names(sim) #response variables: Y1, Y2, Y3 #explanatory factors: #treatment- Y, N #Sex- M, F boxplot(Y1~Treatment) boxplot(Y1~Sex) boxplot(Y1~Treatment*Sex, main="Temperature vs. Sex and Treatment", ylab="Temperature", col=c("lightseagreen","lavender"), pch=21, cex.axis=.9) boxplot(Y2~Treatment) boxplot(Y2~Sex) boxplot(Y2~Treatment*Sex, main="Blood Pressure vs. Sex and Treatment", ylab="Blood Pressure (mmHg)", col=c("lightseagreen","lavender"), cex.axis=.9) boxplot(Y3~Treatment) boxplot(Y3~Sex) boxplot(Y3~Treatment*Sex, main="Temperature vs. Sex and Treatment", ylab="Temperature", labels=c("Female Ctrl","Female Exp","Male Ctrl","Male Exp"), col=c("lightseagreen","lavender"), cex.axis=.9) full.sim<-aov(Y1~Treatment*Sex) #both significant summary(full.sim) full.sim<-aov(Y2~Treatment*Sex) #neither significant summary(full.sim) full.sim<-aov(Y3~Treatment*Sex) #both significant summary(full.sim) two.sim<-aov(Y1~Treatment+Sex) #treatment significantly different summary(two.sim) two.sim<-aov(Y2~Treatment+Sex) #both significantly different summary(two.sim) two.sim<-aov(Y3~Treatment+Sex) #not significantly different summary(two.sim) trt.sim<-aov(Y1~Treatment) #treatments are different summary(trt.sim) trt.sim2<-aov(Y2~Treatment*Sex) #experiment male is significantly different TukeyHSD(trt.sim2) trt.sim3<-aov(Y3~Treatment*Sex) #all are significantly different - treatment effect is conditional upon sex TukeyHSD(trt.sim3) #interaction factor is significant __________________________________________________ 4/29 Chi-Square Test of Independence Association between Categorical Variables •Is Smoking associated with Birth Weight? •Smoking: Yes, No•Birthweight: Low, Normal Is Smoking Associated With Birthweight X^2= (Row.Total * Column Total) / Total Data<-read.csv("birthwt.csv", header=T) attach(Data) #this allows us to use the#variable names boxplot(bwt~smoke) #Boxplot of birth weight (g) #against "smoking", #0, non-smoker #1, smoker Numeric Response, Categorical Factor with 2 Levels --> 2 Sample t-test or ANOVA t.test(bwt~smoke, var.equal=T) data: bwt by smoke = 2.6529, df = 187, p-value = 0.008667alternative hypothesis: true difference in means is not equal to 095 percent confidence interval:72.75612 494.79735sample estimates: mean in group 0 mean in group 1 3055.696 2771.919 Means are different- 0 does not fall within confidence interval --> significant difference, p < .05 Categorical x Categorical --> Contingency Table Approach cont.table<-table(smoke,low) #table(explanatory.variable,response.variable) Cont.table # of individuals of low birth weight from mothers who smoked and didn't smoke low smoke 0 1 0 86 29 normal birthweight 1 44 30 low birthweight Chi-Square Test of Independence h0= the row and column variables are independent Ha= the row and column variables are not independent Assumptions Random samples that are independent Ex: no two children from same mother, no twins Response and explanatory are categorical Each of the expected values is at least 5 test<-chisq.test(cont.table) #chisq.test(contingency.table) #Make the analysis an ‘object’ test$expected #table of the expected values Test Pearson's Chi-squared test with Yates' continuity correction data: cont.table X-squared = 4.2359, df = 1, p-value = 0.03958 Degrees of freedom=(r-1)(C-1) There is an association between the two variables, reject the null hypothesis Average is irrelevant here, Proportions are interesting prop.table(cont.table) #proportions for each cell prop.table(cont.table,1) #proportion of the Row Totals #Of women that don’t smoke, 74.8% and #25.2% #Of women that do smoke, 59.5% and 40.5% prop.table(cont.table,2) #What does this show? Totals may be important in summarizing the data margin.table(cont.table) #total sample size margin.table(cont.table,1) #Row totals margin.table(cont.table,2) #Column totals Fisher's Exact Test Use if any of the expected values are less than 5 fisher.test(cont.table) #p value < .05, 0 not within confidence interval Is Survival Independent of Sex in the Bumpus Birds? bumpus<-read.csv("bumpus.csv",header=T) attach(bumpus) cont.table2<-table(Survived,Sex) Cont.table2 Sex Survived f m FALSE 28 21 TRUE 36 51 test1<-chisq.test(cont.table2) test1$expected test1 Pearson's Chi-squared test with Yates' continuity correction data: cont.table2 X-squared = 2.5257, df = 1, p-value = 0.112 prop.table(cont.table2) prop.table(cont.table2,1) prop.table(cont.table2,2) #p values all > .05 margin.table(cont.table2) margin.table(cont.table2,1) margin.table(cont.table2,2) fisher.test(cont.table2) #p value = .107, 0 is not within confidence interval #fail to reject the null hypothesis #variables are independent Fisher's Exact Test for Count Data data: cont.table2 p-value = 0.107 alternative hypothesis: true odds ratio is not equal to 1 95 percent confidence interval: 0.8769773 4.0844138 sample estimates: odds ratio : 1.879941


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

Janice Dongeun University of Washington

"I used the money I made selling my notes & study guides to pay for spring break in Olympia, Washington...which was Sweet!"

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.