14 Regression #2

# 14 Regression #2 - Regression Estimation...

This preview shows pages 1–21. Sign up to view the full content.

Regression Estimation Lec14.Regression2.ssc alligator.txt

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
alligator\$Length alligator\$Weight 60 80 100 120 140 100 200 300 400 500 600 Alligator Weight vs. Length
Alligator Data t(alligator) 1 2 3 4 5 6 7 8 9 10 11 12 Length 94 74 147 58 86 94 63 86 69 72 128 85 Weight 130 51 640 28 80 110 33 90 36 38 366 84 13 14 15 16 17 18 19 20 21 22 23 24 Length 82 86 88 72 74 61 90 89 68 76 114 90 Weight 80 83 70 61 54 44 106 84 39 42 197 102

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Linear Models ) , 0 ( ~ where ) 4 ( ) 3 ( ) 2 ( ) 1 ( ) 0 ( 2 4 4 3 3 2 2 1 0 3 3 2 2 1 0 2 2 1 0 1 0 0 σε εβ ββ β N x x x x y x x x y x x y x y y i i i i i i i i i i i i i i i i i i i i i + + + + + = + + + + = + + + = + + = + =
Find the set of parameters that minimizes the Sum of Squares Error (SSE) () i i n i i i x y y y 1 0 1 2 ˆ where ˆ SSE minimize ββ + = = =

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Parameter Estimation () = = n i i i x y f 1 2 1 0 1 0 ) , ( ββ my.SSE = function(b0,b1,data=halibut) { y = data[,1] x = data[,2] SSE = sum((y-b0-b1*x)^2) return(SSE) }
my.SSE = function(b0,b1,data=halibut) { y = data[,1] x = data[,2] RSS = sum((y-b0-b1*x)^2) } nn = 50 b0.vec = seq(50,150,length=nn) b1.vec = seq(0,1,length=nn) SSE.matrix = matrix(0,ncol=nn,nrow=nn) for(i in 1:nn) { for(j in 1:nn) SSE.matrix[i,j] = my.SSE(b0.vec[i],b1.vec[j]) } # image(b0.vec,b1.vec,RSS.matrix) # contour(b0.vec,b1.vec,RSS.matrix,nlevels=30) persp(b0.vec,b1.vec,RSS.matrix)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Recall Last Lecture’s Linear Model ) , 0 ( ~ 2 1 0 1 0 σε β ε N where Slope Intercept x y i i i i = = + + =
biomass 150 200 250 300 150 200 250 cpue B1 = 0.8 B1 = 0.6 B1 = 0.4 ? ? 1 0 1 0 = = + + = β ε i i i x y

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
biomass 150 200 250 300 150 200 250 cpue 0 . 1 0 . 0 1 0 1 0 = = + + = β ε i i i x y
6 0 8 1 2 4 X . Y 5 e Z

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
b0.vec b1.vec 60 80 100 120 140 0.0 0.2 0.4 0.6 0.8 1.0 50000 100000 100000 150000 150000 200000 200000 250000 250000 300000 300000 350000 350000 400000 400000 450000 450000 500000 500000 550000 550000 600000 600000 650000 650000 650000 700000 700000 750000 750000 800000 800000 850000 850000 900000 900000 950000 950000 1e6 1e6 1.05e6 1.05e6 1.1e6 1.1e6 1.15e6 1.15e6 1.2e6 1.2e6 1.25e6 1.25e6 1.3e6 1.3e6 1.35e6 1.35e6 1.4e6 1.45e6 1.5e6 1.55e6 1.6e6 1.65e6 1.7e6 1.75e6 1.8e6 1.85e6 1.9e6 1.95e6
biomass 150 200 250 300 150 200 250 cpue y = 66.3 + 0.57 x Best Fit Parameters (Minimize SSE)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Alligator Weight vs. Length alligator\$Length 60 80 100 120 140 100 200 300 400 500 600 alligator\$Weight
Mean, Variance, SE mean(alligator\$Weight) 110.3333 var(alligator\$Weight) 17683.28 length(alligator\$Weight) 24 sqrt(var(alligator\$Weight)/ length(alligator\$Weight)) 27.14412 mean(alligator\$Weight)/ sqrt(var(alligator\$Weight)/ length(alligator\$Weight)) 4.064723 Mean Variance Sample size Standard error t-value

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
alligator0.lm = lm(Weight ~ 1, data = alligator) summary(alligator0.lm) Coefficients: Value Std. Error t value Pr(>|t|) (Intercept) 110.3333 27.1441 4.0647 0.0005 Residual standard error: 133 on 23 degrees of freedom sqrt(sum(resid(alligator0.lm)^2)/ (length(resid(alligator0.lm))-1)) 132.9785 i i y ε β+ = 0
alligator\$Length 60 80 100 120 140 100 200 300 400 500 600 alligator\$Weight i i y ε β+ = 0

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
alligator1. lm = lm(Weight ~ Length, data = alligator) summary(alligator1.lm) Coefficients: Value Std. Error t value Pr(>|t|) (Intercept) -392.2026 48.8918 -8.0218 0.0000 Length 5.8948 0.5581 10.5627 0.0000 Residual standard error: 55.18 on 22 degrees of freedom Multiple R-Squared: 0.8353 Adjusted R-squared: 0.8278 F-statistic: 111.6 on 1 and 22 degrees of freedom, the p-value is 4.418e-010 i i i x y ε β + = 1 0
alligator\$Length 60 80 100 120 140 100 200 300 400 500 600 alligator\$Weight

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
H0: Model 0 and Model 1
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 11/12/2009 for the course BTRY 3010 at Cornell.

### Page1 / 67

14 Regression #2 - Regression Estimation...

This preview shows document pages 1 - 21. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online