Sunday, November 3, 2019

HP 41C and HP 42S: Paired T Statistic

HP 41C and HP 42S: Paired T Statistic

Introduction

The program PAIRT compares two means of two populations.  With this statistic, the paired t statistic test the null hypothesis:

μ_1  = μ_2,  with degrees of freedom n - 1.

Formulas used:

D = 1/n * Σ(x_i - y_i)

S = √(( n * Σ(D^2) - (ΣD)^2) / (n * (n - 1))) / √n

t = D / S

Note:  The default statistics registers are R11 - R16. 

HP 41C/DM 41 Program: PAIRT

01 LBL T^PAIRT
02 T^PAIRED T
03 AVIEW
04 PSE
05 CLΣ
06 LBL 00
07 T^ENTRY Y/X:
08 PROMPT
09 X<>Y
10 -
11 Σ+
12 T^MORE? N=0
13 PROMPT
14 X≠0?
15 GTO 00
16 SDEV
17 RCL 16
18 SQRT
19 /
20 STO 00
21 MEAN
22 RCL 00
23 /
24 ^T=
25 AVIEW
26 PSE
27 END 

HP 42S/DM 42 Program: PAIRT

00 {67-Byte Prgm}
01 LBL "PAIRT"
02 "PAIRED T"
03 AVIEW
04 PSE
05 CLΣ
06 LBL 00
07 "ENTRY Y/X:"
08 PROMPT
09 X<>Y
10 - 
11 Σ+
12 "MORE N=0?"
13 PROMPT
14 X≠0
15 GTO 00
16 SDEV
17 RCL 16
18 SQRT
19 ÷
20 STO 00
21 MEAN
22 RCL÷ 00
23 "T="
24 AVIEW
25 PSE
26 RTN
27 END

Instructions

1.  Run PAIRT, by XEQ PAIRT
2.  For each data point, enter y, press ENTER, then x, then press R/S.  If you have more data points to enter, enter a nonzero value (any nonzero value) at the "MORE? NO=0" prompt.  When you are done, enter 0 at the "MORE? NO=0" prompt. 
3.  At the "T=" prompt, press R/S to see the t statistic.

Example

Data: (x,y)
(4.3, 8.1)
(4.2, 8.6)
(4.5, 9.6)
(13.0, 10.4)

Result:  T = -1.5043

Source:

HP-33E Statistics Applications  Hewlett Packard Company:  Corvallis, OR.  February 1978

Eddie


All original content copyright, © 2011-2019.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.