Trend Analysis
Trend Analysis
Trend Analysis
Trend Analysis
M&D, Chapter 6; Chapter 4 (pp. 169-176) Date: 11/27/05
Slide 1
Trend Analysis
Introduction
When a quantitative factor is used, trend analysis is very useful
Slide 2
Trend Analysis
Linear trend
Standard form of ANOVA could be applied but would not capitalize on the quantitative information available Lets develop a model that specifies that recall is a linear function of study time
Yij = 0 + 1 X j + ij
We know how to obtain 1 by using techniques from linear regression
Slide 3
Trend Analysis
Linear trend
With some algebraic manipulation, we can rewrite 1 in the following manner (assuming equal n):
1 =
c Y
j =1 a j
c2 j
j =1
cj = X j X
Thus, slope of a linear trend can be obtained by forming a contrast of Yj the group means ,where the coefficients take on a special form
cj = X j X
Slide 4
Trend Analysis
Linear fit
By assuming a linear model, the following fit is obtained
In this case the contrast coefficients are c1 = 1.5, = 0.5, c3 = 0.5, and c4 = 1.5
Slide 5
c2
Trend Analysis
Nonlinearity?
Slide 6
Trend Analysis
Nonlinearity
Testing for nonlinearity is a test for departures from linearity Yij = 0 + 1 X j + ij
Yij = 0 + 1 X j + 2 X 2 + 3 X 3 + ij j j
To test for departures from linearity, we need to assess the null hypothesis including all s for j > 1
H 0 : 2 = 3 = ... = a 1 = 0
Slide 7
Luiz Pessoa, Brown University 2005
Trend Analysis
Slide 8
Trend Analysis
Full model
The full model with quadratic and cubic terms
Yij = 0 + 1 X j + 2 X 2 + 3 X 3 ij j j
Has N a df (a = 4 for memory data) When we have a 1 powers of X, the resulting trend passes through the mean value of Y for each group (equal n is assumed)
Predicted score for observations at level j are Y j
Yij ( F ) = Y j
Thus
Trend Analysis
Full model
But we should note that
SSE ( F ) = SS within
Can be rewritten as
Trend Analysis
Example
F=
F(2,20) = 2.38 is not significant at the 0.05 level Possible nonlinearity may reflect sampling error
However, this does not mean that the null hypothesis is true; we lack sufficient evidence to declare coefficients nonzero
Slide 11
Luiz Pessoa, Brown University 2005
Trend Analysis
In many cases, we might be interested in testing for a specific higher order term Most typical case involves testing for quadratic trends Cubic trend is also possible, and higher order trends are fairly rare (though it is always possible to test them)
Slide 12
Trend Analysis
cubic
linear + quadratic
Slide 13
Trend Analysis
Slide 14
Trend Analysis
Slide 15
Trend Analysis
Example
Slide 16
Trend Analysis
Lets call SSdeviation = SSbetween SSlinear The sum of squares attributable to nonlinearity can be partitioned into two components:
SSdeviation = SSquadratic + SScubic
Slide 17
Trend Analysis
Partitioning
When a = 4, the three trend contrasts completely partition the variation between groups
SS between = SS linear + SS quadratic + SS cubic
This holds because the trend contrasts form an orthogonal set (non-overlapping contributions)
Slide 18
Trend Analysis
We found no evidence to reject the null hypothesis: we lacked sufficient evidence to declare nonlinearities But we just saw that we rejected the null hypothesis of 2 = 0 How can the two statements be reconciled?
Slide 19
Trend Analysis
Thus
F= (( SSlinear + SSquadratic + SScubic ) SSlinear ) /( a 2) MS within
Slide 20
Trend Analysis
At the same time, the F test for the quadratic trend by itself is
F= SSquadratic MS within
Slide 21
Trend Analysis
The exact test that one applies will depend on the theoretical framework
Testing deviations from linearity is important Testing specific trends (e.g., quadratic) may also be
Slide 22
Luiz Pessoa, Brown University 2005
Trend Analysis
Slide 23
Trend Analysis
Example
Mean error for each group
Errors suggest that the linear trend is not sufficient to describe the data (pattern in the residuals)
Consistent with the statistically significant quadratic trend
Slide 24
Luiz Pessoa, Brown University 2005
Trend Analysis
Example
A model with both linear and quadratic components included
Slide 25
Trend Analysis
Example
What are the errors of the quadratic model?
Slide 26
Trend Analysis
Cubic trends
What would happen if we included the cubic term?
Because the quadratic trend model provides a very close fit to the sample means, there is no evidence for the need to include the cubic trend in the model To consider more sophisticated techniques, one should consider the more general formalism of curve fitting
Slide 27
Luiz Pessoa, Brown University 2005