1 Regression Homework Solutions EPP 245/298 Statistical Analysis of Laboratory Data.

Slides:



Advertisements
Similar presentations
Regression Discontinuity Design Saralyn Miller Southern Methodist University ____________________ Paper presented at the annual meeting of the Southwest.
Advertisements

5/11/ lecture 71 STATS 330: Lecture 7. 5/11/ lecture 72 Prediction Aims of today’s lecture  Describe how to use the regression model to.
ANOVA ANALYSIS Eighth-Grade Pupils in the Netherlands.
October 6, 2009 Session 6Slide 1 PSC 5940: Running Basic Multi- Level Models in R Session 6 Fall, 2009.
Predicting Success in the National Football League An in-depth look at the factors that differentiate the winning teams from the losing teams. Benjamin.
Regression with ARMA Errors. Example: Seat-belt legislation Story: In February 1983 seat-belt legislation was introduced in UK in the hope of reducing.
Multiple Regression Predicting a response with multiple explanatory variables.
Zinc Data SPH 247 Statistical Analysis of Laboratory Data.
Linear Regression Exploring relationships between two metric variables.
x y z The data as seen in R [1,] population city manager compensation [2,] [3,] [4,]
1 ANOVA Homework Solutions EPP 245/298 Statistical Analysis of Laboratory Data.
SPH 247 Statistical Analysis of Laboratory Data 1April 23, 2010SPH 247 Statistical Analysis of Laboratory Data.
DJIA1 Beneath the Calm Waters: A Study of the Dow Index Group 5 members Project Choice: Hyo Joon You Data Retrieval: Stephen Meronk Statistical Analysis:
Cost of construction of nuclear power plants light water reactor plants cost in dollars e-06 log date permit issued plant capacity log NE USA?
Examining Relationship of Variables  Response (dependent) variable - measures the outcome of a study.  Explanatory (Independent) variable - explains.
1 Some R Basics EPP 245/298 Statistical Analysis of Laboratory Data.
Nemours Biomedical Research Statistics April 2, 2009 Tim Bunnell, Ph.D. & Jobayer Hossain, Ph.D. Nemours Bioinformatics Core Facility.
FISH 397C Winter 2009 Evan Girvetz Basic Statistical Analyses and Contributed Packages in R © R Foundation, from
7/2/ Lecture 51 STATS 330: Lecture 5. 7/2/ Lecture 52 Tutorials  These will cover computing details  Held in basement floor tutorial lab,
MATH 3359 Introduction to Mathematical Modeling Linear System, Simple Linear Regression.
1 Logistic Regression Homework Solutions EPP 245/298 Statistical Analysis of Laboratory Data.
Crime? FBI records violent crime, z x y z [1,] [2,] [3,] [4,] [5,]
Some Analysis of Some Perch Catch Data 56 perch were caught in a freshwater lake in Finland Their weights, lengths, heights and widths were recorded It.
Regression Transformations for Normality and to Simplify Relationships U.S. Coal Mine Production – 2011 Source:
SPH 247 Statistical Analysis of Laboratory Data April 9, 2013SPH 247 Statistical Analysis of Laboratory Data1.
How to plot x-y data and put statistics analysis on GLEON Fellowship Workshop January 14-18, 2013 Sunapee, NH Ari Santoso.
BIOL 582 Lecture Set 19 Matrices, Matrix calculations, Linear models using linear algebra.
A quick introduction to R prog. 淡江統計 陳景祥 (Steve Chen)
PCA Example Air pollution in 41 cities in the USA.
9/14/ Lecture 61 STATS 330: Lecture 6. 9/14/ Lecture 62 Inference for the Regression model Aim of today’s lecture: To discuss how we assess.
Lecture 15: Logistic Regression: Inference and link functions BMTRY 701 Biostatistical Methods II.
SWC Methodology - TWG February 19, 2015 Settlement Document Subject to I.R.E. 408.
Analysis of Covariance Harry R. Erwin, PhD School of Computing and Technology University of Sunderland.
Lecture 5: SLR Diagnostics (Continued) Correlation Introduction to Multiple Linear Regression BMTRY 701 Biostatistical Methods II.
 Combines linear regression and ANOVA  Can be used to compare g treatments, after controlling for quantitative factor believed to be related to response.
7.1 - Motivation Motivation Correlation / Simple Linear Regression Correlation / Simple Linear Regression Extensions of Simple.
Lecture 4: Inference in SLR (continued) Diagnostic approaches in SLR BMTRY 701 Biostatistical Methods II.
Use of Weighted Least Squares. In fitting models of the form y i = f(x i ) +  i i = 1………n, least squares is optimal under the condition  1 ……….  n.
1 Peter Fox Data Analytics – ITWS-4963/ITWS-6965 Week 4b, February 20, 2015 Lab: regression, kNN and K- means results, interpreting and evaluating models.
Regression and Analysis Variance Linear Models in R.
Exercise 8.25 Stat 121 KJ Wang. Votes for Bush and Buchanan in all Florida Counties Palm Beach County (outlier)
Collaboration and Data Sharing What have I been doing that’s so bad, and how could it be better? August 1 st, 2010.
Lecture 9: ANOVA tables F-tests BMTRY 701 Biostatistical Methods II.
Regression Model Building LPGA Golf Performance
Using R for Marketing Research Dan Toomey 2/23/2015
FACTORS AFFECTING HOUSING PRICES IN SYRACUSE Sample collected from Zillow in January, 2015 Urban Policy Class Exercise - Lecy.
Exercise 1 The standard deviation of measurements at low level for a method for detecting benzene in blood is 52 ng/L. What is the Critical Level if we.
Lecture 11 Multicollinearity BMTRY 701 Biostatistical Methods II.
Tutorial 4 MBP 1010 Kevin Brown. Correlation Review Pearson’s correlation coefficient – Varies between – 1 (perfect negative linear correlation) and 1.
Lecture 7: Multiple Linear Regression Interpretation with different types of predictors BMTRY 701 Biostatistical Methods II.
Applied Statistics Week 4 Exercise 3 Tick bites and suspicion of Borrelia Mihaela Frincu
Lecture 6: Multiple Linear Regression Adjusted Variable Plots BMTRY 701 Biostatistical Methods II.
Determining Factors of GPA Natalie Arndt Allison Mucha MA /6/07.
Lecture 6: Multiple Linear Regression Adjusted Variable Plots BMTRY 701 Biostatistical Methods II.
Linear Models Alan Lee Sample presentation for STATS 760.
Exercise 1 The standard deviation of measurements at low level for a method for detecting benzene in blood is 52 ng/L. What is the Critical Level if we.
EPP 245 Statistical Analysis of Laboratory Data 1April 23, 2010SPH 247 Statistical Analysis of Laboratory Data.
Stat 1510: Statistical Thinking and Concepts REGRESSION.
Tutorial 5 Thursday February 14 MBP 1010 Kevin Brown.
The Effect of Race on Wage by Region. To what extent were black males paid less than nonblack males in the same region with the same levels of education.
Nemours Biomedical Research Statistics April 9, 2009 Tim Bunnell, Ph.D. & Jobayer Hossain, Ph.D. Nemours Bioinformatics Core Facility.
1 Analysis of Variance (ANOVA) EPP 245/298 Statistical Analysis of Laboratory Data.
WSUG M AY 2012 EViews, S-Plus and R Damian Staszek Bristol Water.
Peter Fox and Greg Hughes Data Analytics – ITWS-4600/ITWS-6600
Résolution de l’ex 1 p40 t=c(2:12);N=c(55,90,135,245,403,665,1100,1810,3000,4450,7350) T=data.frame(t,N,y=log(N));T; > T t N y
Correlation and regression
REGRESI DENGAN VARABEL FAKTOR/ KUALLTATIF
Data Analytics – ITWS-4600/ITWS-6600/MATP-4450
Console Editeur : myProg.R 1
ITWS-4600/ITWS-6600/MATP-4450/CSCI-4960
Presentation transcript:

1 Regression Homework Solutions EPP 245/298 Statistical Analysis of Laboratory Data

October 27, 2004EPP 245 Statistical Analysis of Laboratory Data 2 Exercise 5.1 > library(ISwR) > data(rmr) > attach(rmr) > names(rmr) [1] "body.weight" "metabolic.rate" > plot(body.weight,metabolic.rate) > rmr.lm <- lm(metabolic.rate ~ body.weight) > abline(coef(rmr.lm),col="red",lwd=2)

October 27, 2004EPP 245 Statistical Analysis of Laboratory Data 3

October 27, 2004EPP 245 Statistical Analysis of Laboratory Data 4 > coef(rmr.lm) (Intercept) body.weight > *70 [1] > sum(coef(rmr.lm)*c(1,70)) [1] > predict(rmr.lm,data.frame(body.weight=70)) [1]

October 27, 2004EPP 245 Statistical Analysis of Laboratory Data 5 > summary(rmr.lm) Call: lm(formula = metabolic.rate ~ body.weight) Residuals: Min 1Q Median 3Q Max Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) e-13 *** body.weight e-09 *** --- Signif. codes: 0 `***' `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 Residual standard error: on 42 degrees of freedom Multiple R-Squared: , Adjusted R-squared: F-statistic: on 1 and 42 DF, p-value: 7.025e-09

October 27, 2004EPP 245 Statistical Analysis of Laboratory Data 6 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) e-13 *** body.weight e-09 *** > * [1] > * [1] > tmp <- summary(rmr.lm) > names(tmp) [1] "call" "terms" "residuals" "coefficients" [5] "aliased" "sigma" "df" "r.squared" [9] "adj.r.squared" "fstatistic" "cov.unscaled" > tmp$coef Estimate Std. Error t value Pr(>|t|) (Intercept) e-13 body.weight e-09 > class(tmp$coef) [1] "matrix" > dim(tmp$coef) [1] 2 4

October 27, 2004EPP 245 Statistical Analysis of Laboratory Data 7 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) e-13 *** body.weight e-09 *** > * [1] > * [1] > tmp$coef[2,1] *tmp$coef[2,2] [1] > tmp$coef[2,1] *tmp$coef[2,2] [1]

October 27, 2004EPP 245 Statistical Analysis of Laboratory Data 8 Exercise 5.2 > data(juul) > names(juul) [1] "age" "menarche" "sex" "igf1" "tanner" "testvol" > attach(juul) > juul.lm 25)) > summary(juul.lm) Call: lm(formula = sqrt(igf1) ~ age, subset = (age > 25)) Residuals: Min 1Q Median 3Q Max Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) <2e-16 *** age <2e-16 *** --- Signif. codes: 0 `***' `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 Residual standard error: on 120 degrees of freedom Multiple R-Squared: 0.446, Adjusted R-squared: F-statistic: 96.6 on 1 and 120 DF, p-value: < 2.2e-16

October 27, 2004EPP 245 Statistical Analysis of Laboratory Data 9

October 27, 2004EPP 245 Statistical Analysis of Laboratory Data 10 > plot(age,igf1) > plot(age[age>25],igf1[age>25]) > abline(coef(lm(igf1 ~ age,sub=(age>25))),col="red",lwd=2) > plot(age[age>25],sqrt(igf1)[age>25]) > abline(coef(juul.lm),col="red",lwd=2)

October 27, 2004EPP 245 Statistical Analysis of Laboratory Data 11

October 27, 2004EPP 245 Statistical Analysis of Laboratory Data 12

October 27, 2004EPP 245 Statistical Analysis of Laboratory Data 13

October 27, 2004EPP 245 Statistical Analysis of Laboratory Data 14

October 27, 2004EPP 245 Statistical Analysis of Laboratory Data 15 > data(malaria)> > names(malaria) [1] "subject" "age" "ab" "mal" > attach(malaria) > hist(ab) > hist(log(ab)) > plot(age,log(ab)) > summary(lm(log(ab) ~ age)) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) <2e-16 *** age * --- Signif. codes: 0 `***' `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 Residual standard error: on 98 degrees of freedom Multiple R-Squared: , Adjusted R-squared: F-statistic: on 1 and 98 DF, p-value: Exercise 5.3

October 27, 2004EPP 245 Statistical Analysis of Laboratory Data 16

October 27, 2004EPP 245 Statistical Analysis of Laboratory Data 17

October 27, 2004EPP 245 Statistical Analysis of Laboratory Data 18

October 27, 2004EPP 245 Statistical Analysis of Laboratory Data 19