Hi, I'm just starting out on R. I have an example data frame listed below.
I have regressed Y on X1. lm(Y~X1). Would like to obtain the Brown-Forsythe
test on residuals.
I am unsure of how to conduct the following steps.
(1) Inputting the residuals from regression into the data frame.
(2) Splitting the groups above (X11) and below mean of X1 (X12) in the data
frame.
(3) Calculating the sum squared deviations of each group residual about the
group median residual.
Is there a quick/dirty way to do this?
Y X1 X2
1 64 4 2
2 73 4 4
3 61 4 2
4 76 4 4
5 72 6 2
6 80 6 4
7 71 6 2
8 83 6 4
9 83 8 2
10 89 8 4
11 86 8 2
12 93 8 4
13 88 10 2
14 95 10 4
15 94 10 2
16 100 10 4
Best,
Louis
[[alternative HTML version deleted]]