Presentation is loading. Please wait.

Presentation is loading. Please wait.

Discussion 3 1/20/2014. Outline How to fill out the table in the appendix in HW3 What does the Model statement do in SAS Proc GLM ( please download lab.

Similar presentations


Presentation on theme: "Discussion 3 1/20/2014. Outline How to fill out the table in the appendix in HW3 What does the Model statement do in SAS Proc GLM ( please download lab."— Presentation transcript:

1 Discussion 3 1/20/2014

2 Outline How to fill out the table in the appendix in HW3 What does the Model statement do in SAS Proc GLM ( please download lab 2 for reference ) – What is a statistical model in layman’s terms – What are the residuals and predicted values How to calculate Variance Components Power questions

3 Questions?

4 How to fill out the table in the appendix in HW3 The treatments are the herbicides used and there are 6 different herbicides (treatments) The pots are the objects that were applied the treatment therefore they are your experimental unit Each pot contained 4 plants therefore 4 measurements were made to each pot (sub- samples)

5 How to fill out the table in the appendix in HW3 Specify what design was used Specify what was measured Specify your what was the treatment applied to Specify what were your treatments and how many levels (i.e. different treatments) Specify if sub-samples were measured and what was measure as a sub-sample

6 What does the Model statement do in SAS Proc GLM What is a statistical model in layman’s terms – A mathematical equation constructed to describe the makeup of an observation or a group of observations – Example: One-way ANOVA model The One-way ANOVA model describes an observation (Y) as a deviation from an overall mean (µ) of a group of observations due to a treatment effect (τ) and the addition of random error (ε).

7 What does the Model statement do in SAS Proc GLM The overall mean (Ῡ.. ) is the mean of all the observations Y ij – Y ij read as observation from the ith treatment and the jth replication. The treatment effect is the deviation from the overall mean Ῡ.. to the treatment mean (Ῡ i. ) The random error is the deviation from the treatment mean (Ῡ i. ) to a given replication of that treatment (Y ij )

8 What are the predicted values? – The theoretical values obtained based on the statistical model (the error is excluded from the model): What are the residuals? – The deviation from the expected values to the observed values: What does the Model statement do in SAS Proc GLM Predicted Y ij — ( )

9 To do ANOVA in SAS we use Proc GLM and specify our model: – Example 3.2 in lab 2: What does the Model statement do in SAS Proc GLM Proc GLM; Class Culture; Model Nlevel = Culture; Means Culture; Output Out = Residual R = Res1 P = Pred1; The Class statement tells SAS that our data is grouped by the variable Culture in the model statement we tell SAS that we want to explain Nlevel by the variable Culture ; therefore: SAS calculates the overall mean and the residuals but what Proc GLM is also calculating is the sums of squares, mean squares, F – values, and p –values for each variable we specify in the model see how in the following slide.

10 How does SAS calculate the sums of square (SS)? What does the Model statement do in SAS Proc GLM Which is equivalent to: When you divide the SS by their respective degrees of freedom the mean squares are obtained (Equivalent to the variances, s 2 ) Where: r = number of replications

11 In Nested Designs: – Example 3.4 in lab 2: What does the Model statement do in SAS Proc GLM Proc GLM; Class Trtmt Pot;* We want SAS to calculate the variances between pots because that will be our error for our ANOVA Model Growth = Trtmt Pot(Trtmt); *Pot is not a treatment. Pot is only an ID variable Random Pot(Trtmt); *must specify pot as random because we are not interested in detecting differences between pots Test H = Trtmt E = Pot(Trtmt);* Here we request a customized F test Where i is treatment ID, j is replication ID, k is subsample ID r = number of replications, s = number of sub-samples Total SS Treatment SSPot SS (e.u.)sub-sample SS

12 How to Calculate Variance Components We analyze nested designs to estimate the variance components which can be used to estimate optimal sub-sample size (section 3.5.2.3 in lecture reading topic 3) The variance components are the estimate of variance for a particular variable (e.g. treatment, experimental unit, and subsample) – The variance components can be calculate using Proc VarComp in SAS

13 In the lecture topic 3 reading section 3.5.2.2 an experiment is described where mint plants are exposed to different treatments of temperature and daylight and stem length was measured There are a total of 6 treatments, 3 pots (replications) per treatment, and 4 plants were measured per pot (subsamples) How to Calculate Variance Components

14 The sums of squares was calculated for treatment, pots and subsamples Then the variances (equivalent to means squares) How to Calculate Variance Components Total SS Treatment SSPot SS (e.u.)sub-sample SS MS TreatmentMS PotMS sub-sample t -1t (r -1)rt (s - 1) Where t = number of treatments, r = number of replications, and s = number of sub-samples

15 The variance due to the sub-sample is the variance due to error: How to Calculate Variance Components MS sub-sample = σ δ 2 To estimate the variance component of the subsample we just calculate the MS of sub- sample rt (s - 1) = 0.93

16 The variance of pots contains the variance of the sub-samples (NOTE: this is not the variance component of pots): How to Calculate Variance Components MS Pots = σ δ 2 + 4σ ε 2 To estimate the variance component of pots we have to solve for σ ε 2. The variance components of pot is calculated below: σ ε 2 = (MS Pots - σ δ 2 ) / 4 σ ε 2 = (2.15 - 0.93) / 4 = 0.30 = 2.15

17 The variance of treatments includes the variance of pots and subsamples (NOTE:): How to Calculate Variance Components MS Treatments = σ δ 2 + 4σ ε 2 + 12Στ 2 /5 = 35.92 To estimate the variance component of treatments only we have to solve for Στ 2 /5 Στ 2 /5 = (MS Treatments - σ δ 2 - 4σ ε 2 ) / 12 Στ 2 /5 = (35.92 - 0.93 – 4*0.3) / 12 = 2.81

18 Power How to use Power Charts for ANOVA


Download ppt "Discussion 3 1/20/2014. Outline How to fill out the table in the appendix in HW3 What does the Model statement do in SAS Proc GLM ( please download lab."

Similar presentations


Ads by Google