06b Morph Homework - Blue Crabs (Answers)

06b Morph Homework - Blue Crabs (Answers) - EXST 7025 –...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: EXST 7025 – Population Statistics Spring 2011 Homework #1 Answers Page 1 dm'log;clear;output;clear'; options ps=512 ls=120 nocenter nodate nonumber FORMCHAR="|----|+|---+=|-/\<>*"; TITLE1 'Blue crab data analysis'; ODS HTML filename FILENAME FILENAME style=minimal body='bluecrab01.HTML' ; input1 'bc data.csv'; OUT1'bluecrab01.CGM'; OUT2'bluecrab02.CGM'; ******************************************************************; *** Source: 2/13/11, http://www.nicholls.edu/bayousphere/ ***; *** GraduateStudents/MDantin/Dantinthesis.pdf ***; ******************************************************************; *** Mattilynn D. Dantin. Distribution and Relative Abundance ***; *** of Blue Crab Callinectes Sapidus in the Upper Barataria ***; *** Estuary, Louisiana. Ms Thesis in Marine and Environmental ***; *** Biology, Nicholls State University, Spring 2007. ***; ******************************************************************; *** Raw data for blue crabs collected from 11 July 2006 to ***; *** 7 November 2006 from Bayou Chevreuil/Lac Des Allemands. ***; ******************************************************************; data AllCrabs JustMales; infile input1 missover DSD dlm="," firstobs=2; input CNo Date $ Site CarapaceWidth CarapaceLength BodyWeight LeftChelaeWeight RightChelaeWeight TotalBodyWeight Sex $; *** remove incomplete observations ***; if CarapaceWidth*CarapaceLength*BodyWeight*LeftChelaeWeight *RightChelaeWeight*TotalBodyWeight = . then delete; *** remove possible outliers ***; if CNo eq 272 then delete; if CNo eq 439 then delete; if CNo eq 274 then delete; if CNo eq 321 then delete; if CNo eq 177 then delete; if CNo eq 435 then delete; if CNo eq 290 then delete; if CNo eq 525 then delete; if CNo eq 369 then delete; if CNo eq 626 then delete; if CNo eq 76 then delete; LTweight = log(TotalBodyWeight); LWidth = log(CarapaceWidth); LLength = log(CarapaceLength); TChelaeWeight = LeftChelaeWeight + RightChelaeWeight; LTChelaeWeight = log(TChelaeWeight); LTotalBodyWeight = log(TotalBodyWeight); PonderalIndex = 100000 * TotalBodyWeight / CarapaceWidth**3; ChelaePercent = TChelaeWeight / TotalBodyWeight; WidthLengthRatio = CarapaceWidth / CarapaceLength; LengthWidthRatio = CarapaceLength / CarapaceWidth; Males = 1; if sex eq 'm' then males = 0; keep CNo Date Site CarapaceWidth CarapaceLength BodyWeight LeftChelaeWeight RightChelaeWeight TotalBodyWeight Sex Males lTweight lWidth lLength TChelaeWeight LTChelaeWeight LTotalBodyWeight PonderalIndex ChelaePercent WidthLengthRatio LengthWidthRatio; ; output AllCrabs; if sex eq 'm' then output JustMales; datalines; run; *proc print data=JustMales; TITLE2 'Raw data print'; run; EXST 7025 – Population Statistics Spring 2011 Homework #1 Answers Page 2 TITLE1 'Blue crab data analysis : males only'; proc means data=justmales n mean min max lclm uclm; TITLE2 'Means of selected variables and ratios'; var CarapaceWidth CarapaceLength BodyWeight LeftChelaeWeight RightChelaeWeight TotalBodyWeight PonderalIndex ChelaePercent WidthLengthRatio LengthWidthRatio; run; proc plot data=JustMales; TITLE2 'Scatter plots of Blue Crab measurements'; plot TotalBodyWeight * CarapaceLength=sex; plot CarapaceWidth * CarapaceLength=sex; plot TChelaeWeight * TotalBodyWeight=sex; options ps=62 ls=132; run; options ps=256 ls=111; ******************************; *** Length - length models ***; ******************************; *** a) The length is what fraction width on the average? (assume the power term is equal to 1 and/or the intercept is equal to 0) b) The width is how much longer than the length on the average? (assume the power term is equal to 1 and/or the intercept is equal to 0) c) Does the assumption(s) you made in parts a & b above appear to be correct? ; proc reg data=JustMales LINEPRINTER outest=est01; ID CarapaceLength; TITLE2 '01: Simple Linear Regression - width on length, unrestricted'; model CarapaceWidth = CarapaceLength / clb; run; proc reg data=JustMales LINEPRINTER outest=est02; ID CarapaceLength; TITLE2 '02: Simple Linear Regression - width on length, intercept = 0'; model CarapaceWidth = CarapaceLength / clb; restrict intercept=0; OUTPUT OUT=NEXT1 P=Predicted R=Resid rstudent=rstudent; run; proc univariate data=next1 normal plot; var Resid; ods exclude basicmeasures extremeobs quantiles testsforlocation; TITLE3 'Residual analysis'; run; proc plot data=next1; plot rstudent*CarapaceLength / vref=-3 0 3; TITLE3 'Residual plot'; options ls=132 ps=61; run; options ps=256 ls=111; proc reg data=JustMales LINEPRINTER outest=est03; ID CarapaceLength; TITLE2 '03: Power model - width on length,, without forced power term'; model LWidth = LLength / clb; Test LLength = 1; run; proc reg data=JustMales LINEPRINTER outest=est04; ID CarapaceLength; TITLE2 '04: Power model - width on length, restricted to power term = 1'; model LWidth = LLength / clb; restrict LLength = 1; OUTPUT OUT=NEXT1 P=Predicted R=Resid rstudent=rstudent; run; proc univariate data=next1 normal plot; var Resid; ods exclude basicmeasures extremeobs quantiles testsforlocation; TITLE3 'Residual analysis'; run; proc plot data=next1; plot rstudent*CarapaceLength / vref=-3 0 3; TITLE3 'Residual analysis'; options ls=132 ps=61; run; options ps=256 ls=111; proc reg data=JustMales LINEPRINTER outest=est05; ID CarapaceLength; TITLE2 '05: Simple Linear Regression - length on width, unrestricted'; model CarapaceLength = CarapaceWidth / clb; run; EXST 7025 – Population Statistics Spring 2011 Homework #1 Answers Page 3 proc reg data=JustMales LINEPRINTER outest=est06; ID CarapaceLength; TITLE2 '06: Simple Linear Regression - length on width, intercept = 0'; model CarapaceLength = CarapaceWidth / clb; restrict intercept=0; OUTPUT OUT=NEXT1 P=Predicted R=Resid rstudent=rstudent; run; proc univariate data=next1 normal plot; var Resid; ods exclude basicmeasures extremeobs quantiles testsforlocation; TITLE3 'Residual analysis'; run; proc plot data=next1; plot rstudent*CarapaceLength / vref=-3 0 3; TITLE3 'Residual plot'; options ls=132 ps=61; run; options ps=256 ls=111; proc reg data=JustMales LINEPRINTER outest=est07; ID CarapaceLength; TITLE2 '07: Power model - length on width, without forced power term'; model LLength = LWidth / clb; Test LWidth = 1; run; proc reg data=JustMales LINEPRINTER outest=est08; ID CarapaceLength; TITLE2 '08: Power model - length on width, power term = 1'; model LLength = LWidth / clb; restrict LWidth = 1; OUTPUT OUT=NEXT1 P=Predicted R=Resid rstudent=rstudent; run; proc univariate data=next1 normal plot; var Resid; ods exclude basicmeasures extremeobs quantiles testsforlocation; TITLE3 'Residual analysis'; run; proc plot data=next1; plot rstudent*CarapaceLength / vref=-3 0 3; TITLE3 'Residual analysis'; options ls=132 ps=61; run; options ps=256 ls=111; ******************************; *** Length - weight models ***; ******************************; * d) Does the weight, when fitted to width, indicate a cubic relationship? (Note: test for a cubic term in the power model, not a polynomial cubic). e) What is the mean value of the ponderal index? That is, when fitted with a cube, what is the mean of the “condition factor”? There are several ways to do this depending on the assumptions you are willing to make. State if you assumed homogeneity of variance of the original raw data and if this assumption appears to be met.; proc reg data=JustMales LINEPRINTER outest=est09; ID CarapaceLength; TITLE2 '09: Power model - no restrictions'; model LTWeight = LWidth / clb; Test LWidth = 3; run; proc reg data=JustMales LINEPRINTER outest=est10; TITLE2 '10: Power model - restrict power = 3'; model LTWeight = LWidth / clb; Restrict LWidth = 3; OUTPUT OUT=NEXT1 P=Predicted R=Resid rstudent=rstudent; run; proc univariate data=next1 normal plot; var Resid; ods exclude basicmeasures extremeobs quantiles testsforlocation; TITLE3 'Residual analysis'; run; proc plot data=next1; plot rstudent*CarapaceLength / vref=-3 0 3; TITLE3 'Residual analysis'; options ls=132 ps=61; run; options ps=256 ls=111; data allest; title2 'Parameter estimates for all models'; set est01 est02 est03 est04 est05 est06 est07 est08 est09 est10; run; EXST 7025 – Population Statistics Spring 2011 Homework #1 Answers Page 4 proc print data=allest; run; ******************************; *** Analysis of Covariance ***; *** Done on All Crabs ***; ******************************; TITLE1 'Blue crab data analysis : all available data'; proc glm data=AllCrabs; class males; TITLE2 'Analysis of covariance - Power model'; model LTChelaeWeight = LTotalBodyWeight | males; OUTPUT OUT=NEXT1 P=Predicted R=Resid rstudent=rstudent; run; proc univariate data=next1 normal plot; var Resid; ods exclude basicmeasures extremeobs quantiles testsforlocation; TITLE3 'Residual analysis'; run; proc plot data=next1; plot rstudent*CarapaceLength / vref=-3 0 3; TITLE3 'Residual analysis'; options ls=132 ps=61; run; options ps=256 ls=111; proc glm data=AllCrabs; class males; TITLE2 'Analysis of covariance - Power model'; model LTChelaeWeight = males LTotalBodyWeight*males / solution noint; proc glm data=AllCrabs; class males; TITLE2 'Analysis of covariance - Linear model'; model TChelaeWeight = TotalBodyWeight | males; OUTPUT OUT=NEXT1 P=Predicted R=Resid rstudent=rstudent; run; proc univariate data=next1 normal plot; var Resid; ods exclude basicmeasures extremeobs quantiles testsforlocation; TITLE3 'Residual analysis'; run; proc plot data=next1; plot rstudent*CarapaceLength / vref=-3 0 3; TITLE3 'Residual analysis'; options ls=132 ps=61; run; options ps=256 ls=111; ODS HTML close; run; quit; run; EXST 7025 – Population Statistics Spring 2011 Homework #1 Answers Blue crab data analysis : males only Means of selected variables and ratios The MEANS Procedure Variable N CarapaceWidth CarapaceLength BodyWeight LeftChelaeWeight RightChelaeWeight TotalBodyWeight PonderalIndex ChelaePercent WidthLengthRatio LengthWidthRatio Mean 513 144.337232 513 65.0311891 513 116.5990253 513 16.2614035 513 17.2434113 513 151.05423 513 4.8725343 513 0.2150834 513 2.2162298 513 0.4521417 144.337232 / 65.0311891 = 2.219507808 65.0311891 / 144.337232 = 0.450550341 Minimum Maximum 101 45 40.04 3.94 3.35 49.37 3.4212915 0.1165626 1.9565217 0.4010695 209 89 270.5 48.64 51.75 386.5 6.7080047 0.2969784 2.4933333 0.5111111 Blue crab data analysis : males only Parameter estimates for all models Obs _DEPVAR_ _RMSE_ Intercept Carapace Length 1 CarapaceWidth 6.1899 ‐16.2718 2.46972 2 CarapaceWidth 6.46581 0 2.22287 3 LWidth 0.04358 0.3534 . 4 LWidth 0.0453 0.7948 . 5 CarapaceLength 2.38042 12.3122 ‐1 6 CarapaceLength 2.90591 0 ‐1 7 LLength 0.03738 0.1304 . 8 LLength 0.0453 ‐0.7948 . 9 LTweight 0.09932 ‐7.7367 . 10 LTweight 0.11644 ‐9.9361 . Calculations Obs _DEPVAR_ Intercept Length 1 CarapaceWidth ‐16.2718 2.46972 2 CarapaceWidth 0 2.22287 3 LWidth 0.3534 1.1059 4 LWidth 0.7948 1 5 CarapaceLength 12.3122 ‐1 6 CarapaceLength 0 ‐1 7 LLength 0.1304 ‐1 8 LLength ‐0.7948 ‐1 9 LTweight ‐7.7367 . 10 LTweight ‐9.9361 . Page 5 Width ‐1 ‐1 ‐1 ‐1 0.36525 0.44898 0.81358 1 2.55684 3 Carapace Width ‐1 ‐1 . . 0.36525 0.44898 . . . . Lower 95% CL for Mean 142.6232565 64.3720533 113.1810158 15.6011303 16.5167195 146.2663958 4.8234303 0.2126899 2.2075355 0.4503609 Upper 95% CL for Mean 146.0512074 65.6903249 120.0170349 16.9216767 17.9701031 155.8420643 4.9216383 0.2174769 2.224924 0.4539225 LLength LWidth LTweight . . 1.1059 1 . . ‐1 ‐1 . . . . ‐1 ‐1 . . 0.81358 1 2.55684 3 . . . . . . . . LTweight EXP(estimate) . . . . EXP(.3534) = 1.4239 EXP(.7948) = 2.2140 . . . . EXP(0.1304) = 1.1393 EXP(‐0.7948) = 0.4517 ‐1 EXP(‐7.7367) = 43.650 ‐1 EXP(‐9.9361) = 4.8398 ‐1 ‐1 EXST 7025 – Population Statistics Spring 2011 Homework #1 Answers Page 6 Blue crab data analysis : all available data Analysis of covariance - Power model Dependent Variable: LTChelaeWeight Source Model Error Corrected Total R-Square 0.953586 Coeff Var 2.911581 DF 3 563 566 Sum of Squares 112.5842586 5.4798239 118.0640825 Root MSE 0.098657 Mean Square 37.5280862 0.0097333 F Value 3855.66 Pr > F <.0001 LTChelaeWeight Mean 3.388443 Source LTotalBodyWeight Males LTotalBodyWeig*Males DF 1 1 1 Type I SS 111.2872050 1.2255002 0.0715535 Mean Square 111.2872050 1.2255002 0.0715535 F Value 11433.7 125.91 7.35 Pr > F <.0001 <.0001 0.0069 Source LTotalBodyWeight Males LTotalBodyWeig*Males DF 1 1 1 Type III SS 27.59878549 0.03805547 0.07155349 Mean Square 27.59878549 0.03805547 0.07155349 F Value 2835.51 3.91 7.35 Pr > F <.0001 0.0485 0.0069 Mean Square 42330.9498 11.0910 F Value 3816.70 Pr > F <.0001 Blue crab data analysis : all available data Analysis of covariance - Linear model Dependent Variable: TChelaeWeight Source Model Error Corrected Total R-Square 0.953135 Coeff Var 10.14405 DF 3 563 566 Sum of Squares 126992.8495 6244.2205 133237.0700 Root MSE 3.330312 TChelaeWeight Mean 32.83021 Source TotalBodyWeight Males TotalBodyWeigh*Males DF 1 1 1 Type I SS 125186.0666 1280.7391 526.0438 Mean Square 125186.0666 1280.7391 526.0438 F Value 11287.2 115.48 47.43 Pr > F <.0001 <.0001 <.0001 Source TotalBodyWeight Males TotalBodyWeigh*Males DF 1 1 1 Type III SS 21774.73584 132.70106 526.04383 Mean Square 21774.73584 132.70106 526.04383 F Value 1963.28 11.96 47.43 Pr > F <.0001 0.0006 <.0001 ...
View Full Document

This note was uploaded on 12/29/2011 for the course EXST 7025 taught by Professor Geaghan,j during the Spring '08 term at LSU.

Ask a homework question - tutors are online