Hypothesis testing four datasets on SAS using Hotelling t-squared hypothesis testing tool to validate all parametric estimates and to conclude if to accept or to reject the given hypothesis
Hypothesis Testing On SAS With Lawley-Hottelling T-sqaured Test
Hypothesis testing in the context of multivariate data is more complex then in ordinary univariate case. The number of parameters may be staggering and in statistics is vital to be able to make solid inference about a population, to test our inference we use a method know as hypothesis testing. In hypothesis testing, we use our sample statisitcs to support or discredit a prior hypothesis, or speculation, about the true value of the population parameter.
Sample Mean Vector Hypothesis Testing
DM
"output;clear;log;clear";
Optionspagesize=45linesize=80PageNo=1NoDate;
OPTIONSFORMCHAR=
"|----|+|---+=|-/\<>*";
Title1"Sample Mean Vector";
ODSHTML body= "ta5_1-body.html"
contents="ta5_1-contents.html"
frame= "ta5_1-frame.html"page= "ta5_1-page.html"
headtext="<title> Inference about a Mean Vector </title>"
anchor="ta5_1";
title"5.11";
DataQ5_11;
Sample+1;
Input Y1-Y2;
Label Y1="Sample Mean One"
X2="Sample Mean Two";
DataLines;
310612514109
;
Proc Print DATA=Q5_11;
Id Sample; run;
title"Multivariate Descriptive Statistics";
Proc IML;
Use Q5_11;
Read ALL var{Y1 Y2} into Y;
N=NROW(Y); P=NCOL(Y);
close Q5_11;
One=SHAPE(1,N,1);
MeanVec=(One`*Y)/N;
M=REPEAT(MeanVec,N,1);
Sigma=(Y-M)`*(Y-M)/(N-1);
print MeanVec, Sigma;
InvS=inv(Sigma);
mu0={611};
*Ho: mu=[6, 11] Ha: mu ne [6, 11];
T2=N*(MeanVec-mu0)*invS*(MeanVec-mu0)`;
CriticalF=
(((N-1)*P)/(N-P))*FINV(0.9, P, N-P);
F=(N-P)/((N-1)*P)*T2;
pval=1-ProbF(F,P,(N-P));
print T2 CriticalF pval;
run;
DM "output;clear;log;clear";
Optionspagesize=45linesize=80PageNo=1NoDate;
OPTIONSFORMCHAR="|----|+|---+=|-/\<>*";
Title1"Cancer Data";
ODSHTML body= "ta5_1-body.html"
contents="ta5_1-contents.html"
frame= "ta5_1-frame.html"page= "ta5_1-page.html"
headtext="<title> Bronchous Cancer Treatment Study </title>"
anchor="ta5_22";
title"Cancer";
DataCancer;
Cancer+1;
Input Y1-Y4;
Label Y1="Admission_Acorbate"
Y2="Untreatability_Ascorbate"
Y3="Admissions_Control"
Y4="Untreatability_Control";
DataLines;
8174723346142313418201684204504509858246874813166115142496350113386450902415511330181513826034166156116203727872722321869321381381002772393153924523118865
;
Proc Print DATA=Cancer;
Id Cancer;
run;
title"Descriptive Statistics Cancer Data";
PROC IML;
USE Cancer;
READ ALL VAR{y1 y2} INTO X1;
READ ALL VAR{y3 y4} INTO X2;
D = X1 - X2;
N = NROW(D);
DBAR = 1/N*D`*J(N,1);
S = 1/(N-1)*D`*(I(N)-1/N*J(N))*D;
print DBAR, S;
InvS=inv(S/N);
MU={0, 0};
T2=(DBAR-MU)`*invS*(DBAR-MU);
print T2;
RUN;
About
Hypothesis testing four datasets on SAS using Hotelling t-squared hypothesis testing tool to validate all parametric estimates and to conclude if to accept or to reject the given hypothesis