Class 4

What you need to have learnt from Class 3.

*
Two types of model.
*
Parallel lines model: different intercepts - same slopes.
*
Non-parallel lines: different intercepts and different slopes.

*
Two key facts in understanding the JMP output.
*
JMP always makes comparisons to the ``average'' of the groups.
*
JMP always leaves one group out - you figure out the missing difference (easy).

*
Non-parallel slopes, an interaction model.
*
Interaction. A three variable concept (Y,X1,X2). Generic description: the impact of X1 on Y depends on the value of X2.
*
Tests: the null hypothesis is always that the differences are zero, that is no difference between the groups. Three types of test: (a) Slope or intercept differences non-zero. (b) Slope differences non-zero? (c) Intercept differences non-zero?
*
Are any of the slope or intercept differences non-zero. (i.e. does adding the categorical variable and its interaction buy us any explanatory power?). Use the partial-F. You have to calculate this one yourself, see p. 233 of the BulkPack.
*
Are any of the slope differences non-zero? Do we need separate slopes (i.e. do we need an interaction term)? Use the partial-F as given on the interaction term in the ``effect test''.
*
Are any of the intercept differences non-zero? Given we don't need interaction, do we need separate intercepts? Use the partial-F as given on the categorical variable term in the ``effect test'' from a model excluding the interaction.

*
A model with different intercepts and same slopes is OK. A model with different intercepts and different slopes is OK. A model with same intercepts but different slopes is not desirable.
*
Our rule: if you have an interaction term in the model (i.e. different slopes) then make sure you have the variables that make up the interaction in the model as well (even if they are not significant).
*
We know the rule for calculating the missing group on the output. It's difference is the number that makes all the differences sum to zero. What about it's t-statistic and p-value? Rule of thumb - (so long as the missing group has roughly as many observations as the included groups and the X-values are similar) use the standard error from the included groups to calculate an approximate t-statistic. Alternatively recode the categorical variable so that the missing group has a coding that comes first in the alphabet and re-run the regression.


New material for today: ANOVA.

ONEWAY ANOVA

*
Objective: compare means (of a Y-variable) across different groups. Example: Is CEO compensation different between sectors?
*
A single continuous Y-variable and one categorical X-variable.
*
Recognize: X (the group variable) is categorical.
*
Conceptually different from regression.
*
Regression usually has a model building and prediction objective.
*
ANOVA has a group comparison objective - no model building.

*
Two basic questions:
*
Are the group means all the same or are some significantly different? Look in the overall ANOVA table to answer this. Analysis done from ``Fit Y by X'' button.
*
If some are different (first test does not tell you which) use follow up and refocus question: compare groups to one another - which ones are significantly different? Various comparison procedures:
*
Compare each pair, one at a time. BAD.
*
Compare all pairs at once. GOOD. Tukey.
*
Compare each group with best. GOOD. Hsu.

*
Critical issue to understand: why is comparing each pair, one pair at a time BAD? Must read pp. 232-234 in Bulk Pack.
*
The procedure which compares each pair, one pair at a time (a two-sample t-test) fails to take into account the number of comparisons we are making. If we make a lot of comparisons then just by chance alone we tend to see something significant. (If we buy many lottery tickets we tend to win the lottery even though any single ticket is unlikely to win.) No fishing.
*
We want to use a procedure that adjusts for the number of comparisons that are made and also recognizes that the comparisons may be data driven. Tukey's and Hsu's do just this. They are multiple comparison procedures with honest Type I error rates. (Recall: Type I error - saying there's a difference when really there is not.) Honest means that when they declare a 5% error rate, then there is a 5% chance of one or more errors in the entire set of comparisons NOT a 5% chance of any particular comparison being wrong.
*
Multiple comparison procedures achieve honesty by making it harder to declare a difference significant.
*
Assumptions: p-values only have credibility if assumptions hold. Check by graphing residuals.
*
Independent errors.
*
Same variance in each group.
*
Approximately normal.

*
Dealing with JMP output for multiple comparisons. Two choices - exactly the same conclusions:
*
Use graphical output (circle clicking).
*
Use table output (reading numbers).


ANOVA with two X-variables

*
Objective: compare means (of a Y-variable) across different groups and combinations of groups.
*
Example: how do gas station average profits depend on incentive scheme and geographic location?
*
A single continuous Y-variable and TWO categorical X-variables
*
Recognize: the X-variables are both categorical.
*
Two basic models:
*
No interaction: the impact of X1 on Y does not depend on the level of X2.
*
Interaction: the impact of X1 on Y depends on the level of X2.

*
Practical consequences:
*
If NO interaction, then you can investigate the impact of each X by itself.
*
If there is interaction (consider practical importance as well as statistical significance) then you must consider both X1 and X2 together.

*
Key graphic - the profile plot. A graphical diagnostic for interaction - look for parallel versus non-parallel lines.
*
After doing a TWOWAY ANOVA, we often compare different combinations of the variables by concatenating the two X's into a single column and doing multiple comparisons. See p.261 and p.270 of the BulkPack.
*
We have the usual assumptions on the errors: independent, constant variance and approximately normal.
*
In JMP we do the TWOWAY ANOVA from the ``fit model'' platform. Residuals can be saved from here. Profile plots are also obtained via this output.



Examples

Repairs.jmp p235. Design.jmp p257. Flextime.jmp p264.


Richard Waterman
Wed Aug 20 16:20:47 EDT 1997