251corp 2/16/98

                                                           Programs for  Statistics

 

                                                Programs for simple Data Computation.

 

Insert  in C1

Program creates  C2=, C3=, C8=,  C9=, C10=., K1=, K2=, K3=, K4=, K5=, K6=, K7=, K8=, K9=, K10=, K11=.

 

 

meanv.mtb

 

let k1=sum(c1)

let c2=c1 * c1

let k2=sum(c2)

let c3=c2 * c1

let k3=sum(c3)

let k5=count(c1)

let k6=k1/k5

let k7=k5-1

let c8=c1-k6

let c9=c8 * c8

let c10=c9* c8

let k8=sum(c8)

let k9=sum(c9)

let k10=sum(c10)

let k4=k9/k7

let k11=sqrt(k4)

describe c1

print c1-c3, c8-c10

print k1-k11

end

 

 

Program Puts out data in columns.

 

meanvout.mtb.

 

write 'c:\minitab\meanv.dat' c1-c3, c8-c10;

tab;

replace.

end

 

 

 


 

                                                Programs for Grouped Data Computation.

 

Insert  in C1 and  in C2

Program creates  C3=, C4=, C5=, C6=, C7=, C8=, C9=., K1=, K2=, K3=, K4=, K5=, K7=, K8=, K9=.

group.mtb

 


let c3=c1*c2

let c4=c3*c2

let c5=c4*c2

let k1=sum(c1)

let k3=sum(c3)

let k4=sum(c4)

let k5=sum(c5)

let k2=k3/k1

print c1-c5

print k1-k5

let c6=c2-k2

let c7=c1*c6

let c8=c7*c6

let c9=c8*c6

let k7 =sum(c7)

let k8 = sum(c8)

let k9 = sum(c9)

print c6-c9

print k7-k9

end


 

Program creates K6=, K10=, K11=, K17=.

groupv.mtb

.

let k6=k1-1

let k10=k8/k6

let k11=k1*k2*k2

let k11=k4-k11

let k11=k11/k6

let k17=sqrt(k11)

end

 

Program creates K12=, K13=, K14=, K15=, K16=, K18=, K19=.

groups.mtb

 


let k12=k6-1

let k13=k1/k6

let k13=k13/k12

let k14=k13*k9

let k15=2*k1*k2*k2*k2

let k16=3*k2*k4

let k15=k5-k16+k15

let k16=k13*k15

let k18=k16/k11

let k18=k18/k17

let k19=k14/k11

let k19=k19/k17

print k1-k19

end


 

 

Program Puts out data in columns.

 

groupout.mtb.

write 'C:\MINITAB\PR97-.DAT' c1-c9;

Tab;

replace.

end

 


 

                                                                Variance and Covariance

 


C1                       input      

C2          

C3                     input

C4

C5

C6

C7

C8

C9

C10         input      

C11         input

C12         input

C13         input

C14         input

C15                     input (horizontal)

C16        

C17                     input(vertical)

C18        

C19        

C20        

C21        

C22        

C23        

C24        

C25        

C26        

C27        

C28        

C29        

 

 


K1          

K2          

K3                      

K4          

K5          

K6          

K7          

K8          

K9          

K10        

K11        

K12        

K13        

K14        

K15        

K16        

K17        

K18        

K19        

K20         Sums

K21         Sums

K22         Sums

K23         Sums

K24         Sums

K25        

K26        

K27        

K28        

K29        


251corp 11/20/97

 

var973.mtb

 

let c2=c1*c1

let k1=sum(c1)

let k2=sum(c2)

let k3=count(c1)

let k4=k1/k3

ket k5=k3*k4*k4

let k5=k3*k4*k4

let k5=k2-k5

print k5

let k7=k3-1

let k5=k5/k7

let k6=sqrt(k5)

describe c1

print c1-c2

print k1-k7

end

 

 

ster973.mtb

 

let k9=c3(1)

let k8=k9-k3

let k29=k9-1

let k29=k8/k29

let k8=k5/k3

print k9, k8. k29

let k8=k8*k29

print k8

let k8=k5/k3

let k8=sqrt(k8)

let k29=sqrt(k29)

print k8, k29

let k8=k8*k29

print k8

end

 

 

marg973.mtb

 

let c18=c10+c11+c12+c13+c14

let c16(1)=sum(c10)

let c16(2)=sum(c11)

let c16(3)=sum(c12)

let c16(4)=sum(c13)

let c16(5)=sum(c14)

let k16=sum(c16)

let k18=sum(c18)

print c10-c18

end

 

 

 

meany.973.mtb

 

print k16,k18

let c20=c10*c17

let c20=c20*c15(1)

let c21=c11*c17

let c21=c21*c15(2)

let c22=c12*c17

let c22=c22*c15(3)

let c23=c13*c17

let c23=c23*c15(4)

let c24=c14*c17

let c24=c24*c15(5)

let c25=c15*c16

let k25=sum(c25)

let c27=c17*c17

let k27=sum(c27)

end

 

 

meanz973.mtb

 

let c27=c17*c18

let k27=sum(c27)

end

 

 

exysq973.mtb

 

let c26=c15*c25

let c28=c17*c27

let k26=sum(c26)

let k28=sum(c28)

print c20-c28

print k25-k28

end

 

 

cov973.mtb

 

let k13=k12-k25*k27

let k15=sqrt(k10)

let k17=sqrt(k11)

let k14=k13/k15

let k14=k14/k17

print k13-k18

end

 

 

 

 

 

251corp 11/20/97

 

tb1973.mtb

 

let c40=c1

let c40(11)=k1

let c41=c2

let c41(11)=k2

write 'c:\minitab\tb1973.dat' c40 c41;

tab;

replace.

end

 

 

 

tb2973.mtb

 

let k30=30

let k31=10

let k32=1

execute 'tb2s973' 5

let c35=c18

let c35(6)=k18

let c35(7)=k25

let c35(8)=k26

let c36=c27

let c36(6)=k27

let c37=c28

let c37(6)=k28

print c30-c37

write 'c:\minitab\tb2973.dat' c30-c37;

tab;

replace.

end.

 

tb2s973.mtb

 

let ck30=ck31

let ck30(6)=c16(k32)

let ck30(7)=c25(k32)

let ck30(8)=c26(k32)

let k30=k30+1

let k31=k31+1

let k32=k32+1

end

 

tb3973.mtb

 

write 'c:\minitab\tb3973.dat' c20-c24;

tab;

replace.

end

 

 

 

 

mast973.mtb

 

execute 'var973'

execute 'ster973'

execute 'marg973'

execute 'meany973'

execute 'meanz973'

execute 'exysq973'

execute 'xyvar973'

execute 'cov973'

execute 'tb1973'

execute 'tb2973'

execute 'tb3973'

end

 

mast988.mtb

same as above without 1st 2 instructions.

 

masta973.mtb

 

write 'c:\minitab\tb2973.dat' c17,c30-c37;

tab;

replace.

end