Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Brain Weight and Body Weight Data Analysis - Prof. A. John Bailer, Study notes of Statistics

Sas code for analyzing brain weight and body weight data for various species. The analysis includes calculating logarithmic values, generating descriptive statistics, and performing allometric scaling using regression analysis. The data includes species names, body weight, brain weight, and logarithmic values of body weight and brain weight.

Typology: Study notes

Pre 2010

Uploaded on 08/18/2009

koofers-user-y70
koofers-user-y70 🇺🇸

2

(1)

10 documents

1 / 66

Toggle sidebar

Related documents


Partial preview of the text

Download Brain Weight and Body Weight Data Analysis - Prof. A. John Bailer and more Study notes Statistics in PDF only on Docsity! Number of Manatees killed regressed on the number of boats registered in Florida The REG Procedure Model: MODEL1 Dependent Variable: manatees Week 04/05 Class Activities File: week-04-05-19sep04.doc Directory: C:\Documents and Settings\John Bailer\My Documents\ baileraj\Classes\Fall 2004\sta402\handouts Based on: C:\Documents and Settings\John Bailer\My Documents\baileraj\ Classes\Fall 2003\sta402\handouts\day10-and-11-17sep03.doc AN INTRODUCTION TO STATISTICAL MODELING * PROC REG for linear modeling (a very basic introduction) * PROC GLM for anova models Other normal response modeling ANOVA – balanced anova models Non-normal response modeling GENMOD – generalized linear models LOGISTIC – [grouped] binary regression PROBIT – [grouped] binary regression (INVERSECL) CATMOD – categorical data modeling Failure time modeling LIFEREG – accelerated failure time models PHREG – Cox’s PH model And more … REGRESSION using PROC REG Basic Model: Yi = 0 +1Xi + i [“simple linear regression”] 14:19 Sunday, November 29, 2020 1 Number of Manatees killed regressed on the number of boats registered in Florida The REG Procedure Model: MODEL1 Dependent Variable: manatees = 0 +1 Xi1 +2 Xi2 +3Xi3 +4 Xi4 +5Xi5 + ij [“multiple linear regression”] Error Assumption: ij ~ indep. N(0, 2) i=1,2,…,n [observations] /* example sas program that does simple linear regression */ options ls=75; data example1; input year nboats manatees; cards; 77 447 13 78 460 21 79 481 24 80 498 16 81 513 24 82 512 20 83 526 15 84 559 34 85 585 33 86 614 33 87 645 39 88 675 43 89 711 50 90 719 47 ; ODS RTF file='D:\baileraj\Classes\Fall 2003\sta402\SAS-programs\linreg- output.rtf’; proc reg; title ‘Number of Manatees killed regressed on the number of boats registered in Florida’; model manatees = nboats / p r cli clm; plot manatees*nboats=”o” p.*nboats=”+” / overlay; plot r.*nboats r.*p.; run; ODS RTF CLOSE; 14:19 Sunday, November 29, 2020 2 Number of Manatees killed regressed on the number of boats registered in Florida The REG Procedure Model: MODEL1 Dependent Variable: manatees Output Statistics Obs -2-1 0 1 2 Cook's D Sum of Residuals 0 Sum of Squared Residuals 219.44991 Predicted Residual SS (PRESS) 281.76275 14:19 Sunday, November 29, 2020 5 Number of Manatees killed regressed on the number of boats registered in Florid: monotees = 41.45 40,1249 aboots 50 35 monotees 25 20 + T T T T T T 425 450475 50D 525550 Plot +++ nonotees+nboots T T T T 575 60D B25 BSD boots +++ PREDenboots T 675 T 700 T 125 Rs ABBE th t] t TBE 14:19 Sunday, November 29, 2020 6 Number of Manatees killed regressed on the number of boats registered in Florid: monotees i) Residual = 41.45 40,1249 nboots + + + “1.5 + + 3.0 15 + OL, T T T T T T T T T T T T 4250 450) ATS. 500525 5D 575 80D 825 85D B75 DD 728 nboots 4 4 R Vides Adje nied RUSE 4.2784 14:19 Sunday, November 29, 2020 7 brain wt - body wt data plot r.*logbody; run; ODS RTF CLOSE; Obs species bodywt brainwt logbody logbrain idino idinobod 1 beaver 1.35 8.1 0.13033 0.90849 0 0.00000 2 cow 465.00 423.0 2.66745 2.62634 0 0.00000 3 wolf 36.33 119.5 1.56027 2.07737 0 0.00000 4 goat 27.66 115.0 1.44185 2.06070 0 0.00000 5 guipig 1.04 5.5 0.01703 0.74036 0 0.00000 6 diplodoc 11700.00 50.0 4.06819 1.69897 1 4.06819 7 asieleph 2547.00 4603.0 3.40603 3.66304 0 0.00000 8 donkey 187.10 419.0 2.27207 2.62221 0 0.00000 9 horse 521.00 655.0 2.71684 2.81624 0 0.00000 10 potarmon 10.00 115.0 1.00000 2.06070 0 0.00000 11 cat 3.30 25.6 0.51851 1.40824 0 0.00000 12 giraffe 529.00 680.0 2.72346 2.83251 0 0.00000 13 gorilla 207.00 406.0 2.31597 2.60853 0 0.00000 14 human 62.00 1320.0 1.79239 3.12057 0 0.00000 15 afreleph 6654.00 5712.0 3.82308 3.75679 0 0.00000 16 tricerat 9400.00 70.0 3.97313 1.84510 1 3.97313 17 rhemonke 6.80 179.0 0.83251 2.25285 0 0.00000 18 kangaroo 35.00 56.0 1.54407 1.74819 0 0.00000 19 hamster 0.12 1.0 -0.92082 0.00000 0 0.00000 20 mouse 0.02 0.4 -1.63827 -0.39794 0 0.00000 21 rabbit 2.50 12.1 0.39794 1.08279 0 0.00000 22 sheep 55.50 175.0 1.74429 2.24304 0 0.00000 23 jaguar 100.00 157.0 2.00000 2.19590 0 0.00000 24 chimp 52.16 440.0 1.71734 2.64345 0 0.00000 25 brachios 87000.00 154.5 4.93952 2.18893 1 4.93952 26 rat 0.28 1.9 -0.55284 0.27875 0 0.00000 27 mole 0.12 3.0 -0.91364 0.47712 0 0.00000 28 pig 192.00 180.0 2.28330 2.25527 0 0.00000 14:19 Sunday, November 29, 2020 10 brain wt - body wt data The UNIVARIATE Procedure Variable: bodywt BODY WEIGHT Moments N 28 Sum Weights 28 Mean 4278.43875 Sum Observations 119796.285 Std Deviation 16480.4904 Variance 271606563 Skewness 5.03388585 Kurtosis 26.0100719 Uncorrected SS 7845918273 Corrected SS 7333377205 Coeff Variation 385.198698 Std Error Mean 3114.51993 Quantiles (Definition 5) Quantile Estimate 100% Max 87000.000 99% 87000.000 95% 11700.000 90% 9400.000 75% Q3 493.000 50% Median 53.830 25% Q1 2.900 10% 0.122 5% 0.120 1% 0.023 0% Min 0.023 Extreme Observations Lowest Highest Value species Obs Value species Obs 0.023 mouse 20 2547 asieleph 7 0.120 hamster 19 6654 afreleph 15 0.122 mole 27 9400 tricerat 16 0.280 rat 26 11700 diplodoc 6 1.040 guipig 5 87000 brachios 25 14:19 Sunday, November 29, 2020 11 brain wt - body wt data The UNIVARIATE Procedure Variable: brainwt BRAIN WEIGHT Moments N 28 Sum Weights 28 Mean 574.521429 Sum Observations 16086.6 Std Deviation 1334.92919 Variance 1782035.94 Skewness 3.33453913 Kurtosis 10.6457044 Uncorrected SS 57357066.9 Corrected SS 48114970.5 Coeff Variation 232.354987 Std Error Mean 252.277904 Quantiles (Definition 5) Quantile Estimate 100% Max 5712.00 99% 5712.00 95% 4603.00 90% 1320.00 75% Q3 421.00 50% Median 137.00 25% Q1 18.85 10% 1.90 5% 1.00 1% 0.40 0% Min 0.40 Extreme Observations Lowest Highest Value species Obs Value species Obs 0.4 mouse 20 655 horse 9 1.0 hamster 19 680 giraffe 12 1.9 rat 26 1320 human 14 3.0 mole 27 4603 asieleph 7 5.5 guipig 5 5712 afreleph 15 14:19 Sunday, November 29, 2020 12 brain wt — body wt data allonetrit scoling - broin ond body wt [AIT Species combined] logbroin = 1,1096 +0, 496 logbody a Residual logbody this AdjR ian RUSE 0.6652 14:19 Sunday, November 29, 2020 15 brain wt - body wt data Dinosaurs fitted with potentially different line The REG Procedure Model: MODEL1 Dependent Variable: logbrain Analysis of Variance Source DF Sum of Squares Mean Square F Value Pr > F Model 3 27.01211 9.00404 93.82 <.0001 Error 24 2.30324 0.09597 Corrected Total 27 29.31535 Root MSE 0.30979 R-Square 0.9214 Dependent Mean 1.92195 Adj R-Sq 0.9116 Coeff Var 16.11844 Parameter Estimates Variable DF Parameter Estimate Standard Error t Value Pr > |t| Intercept 1 0.93391 0.08562 10.91 <.0001 logbody 1 0.75226 0.04493 16.74 <.0001 idino 1 -0.91748 1.79054 -0.51 0.6131 idinobod 1 -0.31441 0.41371 -0.76 0.4547 14:19 Sunday, November 29, 2020 16 brain wt — body wt data Dinosours fitted with potentiolly different line logbroin = 0.9539 40.7525 logbody -D.9175idino -0. 3144 idinobod logbrain 40 + t + + + + + #4 + + » + + + t + at + + + + + + T T T T T T 2 0 | 2 3 logbody Plot +++ logbroinelogbady +++ PRED logbody Rs a 3098 14:19 Sunday, November 29, 2020 17 brain wt — body wt data Dinosours fitted with potentiolly different INTERCEPTS loghroin = 0.9588 40.7486 logbody -2.2667 idino 40 logbroin + + ty + logbody Plot +++ logbroinslogbody +++ PRED#loghody Rs 5 i 12 a a 14:19 Sunday, November 29, 2020 20 One-way ANOVA Basic Model: Yij = i + ij [“cell means” coding] =  + i + ij [“effects” coding] (constraint for estimation? 1=0 or g=0 or  i=0) Error Assumption: 14:19 Sunday, November 29, 2020 21 ij ~ indep. N(0, 2) i=1,2,…,g [treatments or populations] j=1,2,…,ni [replications] H0: 1 = … = g or equivalently, H0: 1 = … = g=0 /* Bacteria in meat under 4 different conditions */ options ls = 75; data meat; input condition $ logcount @@; datalines; Plastic 7.66 Plastic 6.98 Plastic 7.80 Vacuum 5.26 Vacuum 5.44 Vacuum 5.80 Mixed 7.41 Mixed 7.33 Mixed 7.04 Co2 3.51 Co2 2.91 Co2 3.66 ; title bacteria growth under 4 packaging conditions; ODS RTF file='D:\baileraj\Classes\Fall 2003\sta402\SAS-programs\oneway- output.rtf’; proc boxplot; plot logcount*condition; run; proc glm data=meat order=data; title2 fitting the one-way anova model via GLM; class condition; model logcount = condition; means condition / bon tukey scheffe cldiff lines; lsmeans condition / cl pdiff; contrast ‘plastic vs. rest’ condition 3 –1 –1 –1; output out=new p=yhat r=resid stdr=eresid; run; proc plot data=new; title2 residual analyses; plot resid*yhat; run; proc univariate data=new plot; var resid; run; 14:19 Sunday, November 29, 2020 22 bacteria growth under 4 packaging conditions fitting the one-way anova model via GLM The GLM Procedure Dependent Variable: logcount Source DF Sum of Squares Mean Square F Value Pr > F Model 3 32.87280000 10.95760000 94.58 <.0001 Error 8 0.92680000 0.11585000 Corrected Total 11 33.79960000 R-Square Coeff Var Root MSE logcount Mean 0.972580 5.768940 0.340367 5.900000 Source DF Type I SS Mean Square F Value Pr > F condition 3 32.87280000 10.95760000 94.58 <.0001 Source DF Type III SS Mean Square F Value Pr > F condition 3 32.87280000 10.95760000 94.58 <.000 1 14:19 Sunday, November 29, 2020 25 bacteria growth under 4 packaging conditions fitting the one-way anova model via GLM The GLM Procedure Tukey's Studentized Range (HSD) Test for logcount NOTE: This test controls the Type I experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 8 Error Mean Square 0.11585 Critical Value of Studentized Range 4.52880 Minimum Significant Difference 0.89 Comparisons significant at the 0.05 level are indicated by ***. condition Comparison Difference Between Means Simultaneous 95% Confidence Limits Plastic - Mixed 0.2200 -0.6700 1.1100 Plastic - Vacuum 1.9800 1.0900 2.8700 *** Plastic - Co2 4.1200 3.2300 5.0100 *** Mixed - Plastic -0.2200 -1.1100 0.6700 Mixed - Vacuum 1.7600 0.8700 2.6500 *** Mixed - Co2 3.9000 3.0100 4.7900 *** Vacuum - Plastic -1.9800 -2.8700 -1.0900 *** Vacuum - Mixed -1.7600 -2.6500 -0.8700 *** Vacuum - Co2 2.1400 1.2500 3.0300 *** Co2 - Plastic -4.1200 -5.0100 -3.2300 *** Co2 - Mixed -3.9000 -4.7900 -3.0100 *** Co2 - Vacuum -2.1400 -3.0300 -1.2500 ** * 14:19 Sunday, November 29, 2020 26 bacteria growth under 4 packaging conditions fitting the one-way anova model via GLM The GLM Procedure Bonferroni (Dunn) t Tests for logcount NOTE: This test controls the Type I experimentwise error rate, but it generally has a higher Type II error rate than Tukey's for all pairwise comparisons. Alpha 0.05 Error Degrees of Freedom 8 Error Mean Square 0.11585 Critical Value of t 3.47888 Minimum Significant Difference 0.9668 Comparisons significant at the 0.05 level are indicated by ***. condition Comparison Difference Between Means Simultaneous 95% Confidence Limits Plastic - Mixed 0.2200 -0.7468 1.1868 Plastic - Vacuum 1.9800 1.0132 2.9468 *** Plastic - Co2 4.1200 3.1532 5.0868 *** Mixed - Plastic -0.2200 -1.1868 0.7468 Mixed - Vacuum 1.7600 0.7932 2.7268 *** Mixed - Co2 3.9000 2.9332 4.8668 *** Vacuum - Plastic -1.9800 -2.9468 -1.0132 *** Vacuum - Mixed -1.7600 -2.7268 -0.7932 *** Vacuum - Co2 2.1400 1.1732 3.1068 *** Co2 - Plastic -4.1200 -5.0868 -3.1532 *** Co2 - Mixed -3.9000 -4.8668 -2.9332 *** Co2 - Vacuum -2.1400 -3.1068 -1.1732 ** * 14:19 Sunday, November 29, 2020 27 bacteria growth under 4 packaging conditions fitting the one-way anova model via GLM The GLM Procedure Bonferroni (Dunn) t Tests for logcount NOTE: This test controls the Type I experimentwise error rate, but it generally has a higher Type II error rate than REGWQ. Alpha 0.05 Error Degrees of Freedom 8 Error Mean Square 0.11585 Critical Value of t 3.47888 Minimum Significant Difference 0.9668 Means with the same letter are not significantly different. Bon Grouping Mean N condition A 7.4800 3 Plastic A A 7.2600 3 Mixed B 5.5000 3 Vacuum C 3.3600 3 Co2 14:19 Sunday, November 29, 2020 30 bacteria growth under 4 packaging conditions fitting the one-way anova model via GLM The GLM Procedure Scheffe's Test for logcount NOTE: This test controls the Type I experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 8 Error Mean Square 0.11585 Critical Value of F 4.06618 Minimum Significant Difference 0.9706 Means with the same letter are not significantly different. Scheffe Grouping Mean N condition A 7.4800 3 Plastic A A 7.2600 3 Mixed B 5.5000 3 Vacuum C 3.3600 3 Co2 14:19 Sunday, November 29, 2020 31 bacteria growth under 4 packaging conditions fitting the one-way anova model via GLM The GLM Procedure Least Squares Means condition logcount LSMEAN LSMEAN Number Plastic 7.48000000 1 Vacuum 5.50000000 2 Mixed 7.26000000 3 Co2 3.36000000 4 Least Squares Means for effect condition Pr > |t| for H0: LSMean(i)=LSMean(j) Dependent Variable: logcount i/j 1 2 3 4 1 <.0001 0.4514 <.0001 2 <.0001 0.0002 <.0001 3 0.4514 0.0002 <.0001 4 <.0001 <.0001 <.0001 condition logcount LSMEAN 95% Confidence Limits Plastic 7.480000 7.026844 7.933156 Vacuum 5.500000 5.046844 5.953156 Mixed 7.260000 6.806844 7.713156 Co2 3.360000 2.906844 3.813156 Least Squares Means for Effect condition i j Difference Between Means 95% Confidence Limits for LSMean(i)-LSMean(j) 1 2 1.980000 1.339141 2.620859 1 3 0.220000 -0.420859 0.860859 1 4 4.120000 3.479141 4.760859 2 3 -1.760000 -2.400859 -1.119141 2 4 2.140000 1.499141 2.780859 3 4 3.900000 3.259141 4.540859 14:19 Sunday, November 29, 2020 32 bacteria growth under 4 packaging conditions residual analyses Plot of resid*yhat. Legend: A = 1 obs, B = 2 obs, etc. resid ‚ ‚ 0.4 ˆ ‚ ‚ ‚ A 0.3 ˆ A A ‚ ‚ ‚ 0.2 ˆ ‚ A ‚ A A ‚ 0.1 ˆ ‚ A ‚ ‚ 0.0 ˆ ‚ ‚ A ‚ -0.1 ˆ ‚ ‚ ‚ -0.2 ˆ ‚ A ‚ A ‚ -0.3 ˆ ‚ ‚ ‚ -0.4 ˆ ‚ ‚ A ‚ -0.5 ˆ A ‚ Šƒˆƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒˆƒ 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 yhat 14:19 Sunday, November 29, 2020 35 bacteria growth under 4 packaging conditions residual analyses The UNIVARIATE Procedure Variable: resid Moments N 12 Sum Weights 12 Mean 0 Sum Observations 0 Std Deviation 0.29026634 Variance 0.08425455 Skewness -0.6294875 Kurtosis -0.971163 Uncorrected SS 0.9268 Corrected SS 0.9268 Coeff Variation . Std Error Mean 0.08379267 Quantiles (Definition 5) Quantile Estimate 100% Max 0.32 99% 0.32 95% 0.32 90% 0.30 75% Q3 0.24 50% Median 0.11 25% Q1 -0.23 10% -0.45 5% -0.50 1% -0.50 0% Min -0.50 Extreme Observations Lowest Highest Value Obs Value Obs -0.50 2 0.15 7 -0.45 11 0.18 1 -0.24 4 0.30 6 -0.22 9 0.30 12 -0.06 5 0.32 3 Stem Leaf # Boxplot 3 002 3 | 2 +-----+ 1 558 3 *-----* 0 7 1 | + | -0 6 1 | | -1 | | -2 42 2 +-----+ 14:19 Sunday, November 29, 2020 36 bacteria growth under 4 packaging conditions residual analyses The UNIVARIATE Procedure Variable: resid -3 | -4 5 1 | -5 0 1 | ----+----+----+----+ Multiply Stem.Leaf by 10**-1 Normal Probability Plot 0.35+ * *++ * | ++++ | * *+*+ 0.05+ *++++ | *++ | +++ -0.25+ ++*+ * | +++ | +*++ * -0.55+ +++ +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 14:19 Sunday, November 29, 2020 37 Two-way ANOVA/ Factorial example 2 - interaction plots Patient Waiting Time data Obs doctype practype time 1 gen group 15 2 gen group 20 3 gen group 25 4 gen group 20 5 gen solo 20 6 gen solo 25 7 gen solo 30 8 gen solo 25 9 spec group 30 10 spec group 25 11 spec group 30 12 spec group 35 13 spec solo 25 14 spec solo 20 15 spec solo 30 16 spec solo 30 14:19 Sunday, November 29, 2020 40 Two-way ANOVA/ Factorial example 2 - interaction plots Patient Waiting Time data Plot of timemean*doctype. Symbol is value of practype. timemean ‚ 35 ˆ ‚ ‚ ‚ ‚ ‚ 30 ˆ g ‚ ‚ ‚ ‚ s ‚ 25 ˆ s ‚ ‚ ‚ ‚ ‚ 20 ˆ g ‚ ‚ ‚ ‚ ‚ 15 ˆ ‚ ‚ ‚ ‚ ‚ 10 ˆ ‚ ‚ ‚ ‚ ‚ 5 ˆ ‚ ‚ ‚ ‚ ‚ 0 ˆ ‚ Šƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒ gen spec doctype 14:19 Sunday, November 29, 2020 41 Two-way ANOVA/ Factorial example 2 - interaction plots Patient Waiting Time data The GLM Procedure Class Level Information Class Levels Values doctype 2 gen spec practype 2 group solo Number of observations 16 14:19 Sunday, November 29, 2020 42 Two-way ANOVA/ Factorial example 2 - interaction plots Patient Waiting Time data The GLM Procedure Tukey's Studentized Range (HSD) Test for time NOTE: This test controls the Type I experimentwise error rate, but it generally has a higher Type II error rate than REGWQ. Alpha 0.05 Error Degrees of Freedom 12 Error Mean Square 18.22917 Critical Value of Studentized Range 3.08132 Minimum Significant Difference 4.6513 Means with the same letter are not significantly different. Tukey Grouping Mean N doctype A 28.125 8 spec B 22.500 8 gen 14:19 Sunday, November 29, 2020 45 Two-way ANOVA/ Factorial example 2 - interaction plots Patient Waiting Time data The GLM Procedure Tukey's Studentized Range (HSD) Test for time NOTE: This test controls the Type I experimentwise error rate, but it generally has a higher Type II error rate than REGWQ. Alpha 0.05 Error Degrees of Freedom 12 Error Mean Square 18.22917 Critical Value of Studentized Range 3.08132 Minimum Significant Difference 4.6513 Means with the same letter are not significantly different. Tukey Grouping Mean N practype A 25.625 8 solo A A 25.000 8 group 14:19 Sunday, November 29, 2020 46 Level of doctype Level of practype N time Mean Std Dev gen group 4 20.0000000 4.08248290 gen solo 4 25.0000000 4.08248290 spec group 4 30.0000000 4.08248290 spec solo 4 26.2500000 4.78713554 14:19 Sunday, November 29, 2020 47 ODS RTF CLOSE; ODS RTF file='D:\baileraj\Classes\Fall 2003\sta402\SAS-programs\week5- fig1a.rtf'; proc gplot data=class.manatee; title h=1.5 'A plot of the number of manatee deaths versus the number of boats registered in Florida'; 14:19 Sunday, November 29, 2020 50 title2 h=1 '[Regression line with CI for mean along with smoothing spline fit displayed]'; symbol1 interpol=rlclm95 /* r=regression, l=linear (q,c also possible), clm=conf. int. mean (cli option), 95= conf. level */ value=diamond height=3 cv=red ci=blue co=green width=2; symbol2 interpol=SM55s /* smoothing spline (SM) that first sorts the x-axis data */ ; plot manatees*nboats manatees*nboats / hminor=1 overlay regeqn; /* adds regression eqn to bottom left of plot */ run; ODS RTF CLOSE; 14:19 Sunday, November 29, 2020 51 libname class 'D:\baileraj\Classes\Fall 2003\sta402\data’; proc format; value totfmt 0='none' 1-HIGH='some' ; /* creates a permanent dataset with the nitrofen data */ data class.nitrofen; infile 'M:\public.www\classes\sta402\SAS-programs\ch2-dat.txt' firstobs=16 expandtabs missover pad ; 14:19 Sunday, November 29, 2020 52 3 80 1 10 31.50 3.2745 4 160 1 10 28.30 2.3594 5 235 1 10 17.20 5.9029 6 310 1 10 6.00 3.7118 ODS RTF file='D:\baileraj\Classes\Fall 2003\sta402\SAS-programs\week5- fig3.rtf'; proc gplot data=nitromean; title h=1.5 'Plot of mean number of C. dubia young produced at different Nitrofen concentrations'; title2 h=1 '[bubble area proportional to std dev.]'; bubble n_mean*conc=n_sd / bsize=15; /* bsize helps resize bubble for display */ run; ODS RTF CLOSE; 14:19 Sunday, November 29, 2020 55 GCHART figures ODS RTF file='D:\baileraj\Classes\Fall 2003\sta402\SAS-programs\week5- fig4.rtf'; goptions reset=global gunit=pct border cback=white colors=(black blue green red) ftext=swiss 14:19 Sunday, November 29, 2020 56 ftitle=swissb htitle=5 htext=3.5; title1 'Average Total Young by Nitrofen concentration'; axis1 label=('Total Young' j=c 'Error Bar Confidence Limits: 95%') minor=(number=1); axis2 label=('Nitrofen' j=r 'Concentration'); pattern1 color=cyan; proc gchart data=class.nitrofen; hbar conc / type=mean sumvar=total /* freqlabel='Number in Group' */ /* meanlabel='Mean Number Young' */ errorbar=bars clm=95 midpoints=(0 80 160 235 310) raxis=axis1 maxis=axis2 noframe coutline=black; run; ODS RTF CLOSE; 14:19 Sunday, November 29, 2020 57 GREPLAY figures /* now trying something fancy using templates and GREPLAY to get multiple figures on a page REF: http://www.units.muohio.edu/doc/sassystem/sasonlinedocv8/sasdoc/sashtml/gref/z61-ex.htm 14:19 Sunday, November 29, 2020 60 */ libname class 'D:\baileraj\Classes\Fall 2003\sta402\data’; /* libname class previously defined */ goptions reset=global gunit=pct border cback=white colors=(black blue green red) ftext=swissb htitle=6 htext=3; proc greplay tc=class.tempcat nofs; tdef newtemp des='Five panel template' 1/llx=0 lly=10 ulx=0 uly=50 urx=50 ury=50 lrx=50 lry=10 color=blue 2/llx=0 lly=50 ulx=0 uly=90 urx=50 ury=90 lrx=50 lry=50 color=red 3/llx=50 lly=50 ulx=50 uly=90 urx=100 ury=90 lrx=100 lry=50 color=green 4/llx=50 lly=10 ulx=50 uly=50 urx=100 ury=50 lrx=100 lry=10 color=cyan; template newtemp; list template; quit; proc gplot data=class.nitrofen gout=class.graph; title c=red 'Brood 1'; plot brood1*conc; run; title 'Brood 2'; plot brood2*conc; run; title 'Brood 3'; plot brood3*conc; run; title 'TOTAL'; plot total*conc; run; goptions hsize=0in vsize=0in; proc gslide gout=class.graph; 14:19 Sunday, November 29, 2020 61 title 'PLOT of brood and total responses versus nitrofen concentration'; run; goptions display; ODS RTF file='D:\baileraj\Classes\Fall 2003\sta402\SAS-programs\week5- fig6.rtf'; proc greplay igout=class.graph gout=class.excat tc=class.tempcat nofs template=newtemp; treplay 3:gplot2 /* plot bottom left - brood 3 */ 1:gplot /* top left - brood 1 */ 2:gplot1 /* top right - brood 2 */ 4:gplot3 ; /* bottom right - total */ quit; ODS RTF CLOSE; 14:19 Sunday, November 29, 2020 62 proc means data=new; class conc brood; var young; output out=new3 mean=ymean; run; ODS RTF file='D:\baileraj\Classes\Fall 2003\sta402\SAS-programs\week5- fig8.rtf'; proc g3d data=new3; 14:19 Sunday, November 29, 2020 65 title h=1 'Surface plot of mean # young by conc. and brood'; plot conc*brood=ymean / xticknum=2 yticknum=2 tilt=80; run; quit; ODS RTF CLOSE; 14:19 Sunday, November 29, 2020 66
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved