The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
(21S) Analysis of Variance - Complete one-way ANOVA table
02-03-2021, 09:50 PM
Post: #1
(21S) Analysis of Variance - Complete one-way ANOVA table
This program computes the complete one-way ANOVA table for any number of treatment groups. Analysis of variance is used to test whether a difference within the means of multiple groups is likely to be due to chance, or whether the difference is statistically significant. The program is designed to interoperate with the F distribution functions on the 21S, making it particularly well suited for this model. It should also work on the 20S, though you will need an F-distribution table, or some other means of obtaining your threshold F value.

Usage

Press CLRG to clear all registers and begin a new case. Enter the data points from the first group, each followed by pressing Σ+. Do not press the INPUT key, as this will cause Σ+ to accumulate x and y values, destroying intermediate results stored in R6, R8, and R9. In other words, make sure the : isn't displayed when pressing Σ+.

When you have completed entering data for the group, you may press RCL 5 to see the sum, XEQ B to compute the mean, or XEQ C to compute the sample standard deviation for the group. These three calculations are optional.

Press XEQ A after the last data point of each group has been entered.

To compute the ANOVA table, use the following keystrokes, in any order (and omitting any results you are not interested in) to calculate each result:

XEQ F : F Ratio (also calculates and stores df1, df2)
XEQ 1 : df1 (Treatment Degrees of Freedom - result is displayed and stored in R1)
XEQ 2 : df2 (Error Degrees of Freedom - result is displayed and stored in R2)
XEQ 1 + XEQ 2 = : df3 (Total Degrees of Freedom)
XEQ 3 : TSS (Total Sum of Squares)
XEQ 4 : TrSS (Treatment Sum of Squares)
XEQ 5 : ESS (Error Sum of Squares)
XEQ 6 : TrMS (Treatment Mean Square - also calculates and stores df1)
XEQ 7 : EMS (Error Mean Square - also calculates and stores df2)

Calculating TrMS automatically stores df1 into R1, calculating EMS stores df2 into R2, and calculating F stores both df1 and df2 into their respective registers. You can then immediately use the F ratio and stored df1 and df2 values with the built-in Q(F) or Fp functions to determine whether to reject the null hypothesis which states that the means of the groups are equal.


Example

This example is from the HP 67 Stat Pac I.

The following are the scores obtained in an achievement test by random samples of students from four different schools.

School 1: 88, 99, 96, 68, 85
School 2: 78, 62, 98, 83, 61, 88
School 3: 80, 61, 74, 92, 78, 54, 77
School 4: 71, 65, 90, 46

Calculate the ANOVA table and test the null hypothesis that the differences among the sample means can be attributed to chance. Use significance level α=0.01.

Code:
Keystrokes  Output      Notes

CLRG                    Start new case
        
88 Σ+       1           n
99 Σ+       2   
96 Σ+       3   
68 Σ+       4   
85 Σ+       5   
RCL 5       436         Sum
XEQ B       87.2        Mean
XEQ C       12.1532     Std Dev
XEQ A       1           Group #
        
78 Σ+       1   
62 Σ+       2   
98 Σ+       3   
83 Σ+       4   
61 Σ+       5   
88 Σ+       6   
RCL 5       470         Sum
XEQ B       78.3333     Mean
XEQ C       14.6242     Std Dev
XEQ A       2           Group #
        
80 Σ+       1   
61 Σ+       2   
74 Σ+       3   
92 Σ+       4   
78 Σ+       5   
54 Σ+       6   
77 Σ+       7   
RCL 5       516         Sum
XEQ B       73.7143     Mean
XEQ C       12.6057     Std Dev
XEQ A       3           Group #
        
71 Σ+       1   
65 Σ+       2   
90 Σ+       3   
46 Σ+       4   
RCL 5       272         Sum
XEQ B       68          Mean
XEQ C       18.1292     Std Dev
XEQ A       4           Group #

XEQ 3       4530.0000   TSS
XEQ 4       930.4381    TrSS
XEQ 5       3599.5619   ESS

XEQ 1       3           df1
+ XEQ 2     18          df2
=           21          df3

XEQ 6       310.1460    TrMS
XEQ 7       199.9757    EMS
XEQ F       1.5509      F

Q(F)        0.2358      Upper tail F(1.5509, 3, 18)
.01 Fp      5.0919      F value for F(x, 3, 18)=0.01

Since F(1.5509, 3, 18)=0.2358, and the calculated F value 1.5509 does not exceed F(.01, 3, 18)=5.0919, the null hypothesis cannot be rejected. We conclude that the means of the scores for the four schools are not significantly different.


Program Listing

Code:
01  LBL A
02  RCL 5
03  STO + 6
04  x^2
05  /
06  RCL 4
07  STO + 9
08  =
09  STO + 0
10  RCL 7
11  STO + 8
12  C
13  STO 4
14  STO 5
15  STO 7
16  1
17  STO + 3
18  RCL 3
19  RTN
20  LBL 1
21  (
22  RCL 3
23  -
24  1
25  )
26  STO 1
27  RTN
28  LBL 2
29  (
30  RCL 9
31  -
32  RCL 3
33  )
34  STO 2
35  RTN
36  LBL 3
37  (
38  RCL 8
39  GTO 0
40  LBL 4
41  (
42  RCL 0
43  LBL 0
44  -
45  RCL 6
46  x^2
47  /
48  RCL 9
49  )
50  RTN
51  LBL 5
52  (
53  XEQ 3
54  -
55  XEQ 4
56  )
57  RTN
58  LBL 6
59  (
60  XEQ 4
61  /
62  XEQ 1
63  )
64  RTN
65  LBL 7
66  (
67  XEQ 5
68  /
69  XEQ 2
70  )
71  RTN
72  LBL F
73  XEQ 6
74  /
75  XEQ 7
76  =
77  RTN
78  LBL B
79  (
80  RCL 5
81  /
82  RCL 4
83  )
84  RTN
85  LBL C
86  RCL 7
87  -
88  RCL 4
89  *
90  XEQ B
91  x^2
92  =
93  /
94  (
95  RCL 4
96  -
97  1
98  =
99  SQRT
Checksum: 4AF8
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(21S) Analysis of Variance - Complete one-way ANOVA table - Dave Britten - 02-03-2021 09:50 PM



User(s) browsing this thread: 2 Guest(s)