-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path6Chi-Square.sas
More file actions
46 lines (35 loc) · 1.36 KB
/
Copy path6Chi-Square.sas
File metadata and controls
46 lines (35 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* Getting Your Feet Wet With SAS
Example 7.13 Chi-Square Test of Independence
Reading p. 322; Code p. 338 */
/* Is there a relationship between gender and treatment regimen?
Suppose an investigator is interested in evaluating whether or not
treatment regimens differ by gender. Restricting our analyes to the
HMO patients, the following table displays the number of male and
female patients according to their treatment regimens. Based on the
data, is there evidence of a significant relationship between gender
and treatment regimen among the HMO patients? Test if there is a
relationship between site and treatment regimen using the chi-square
test of independence in SAS. */
options ps=62 ls=80;
data in;
input gender $ trt $ count;
cards;
male diet 147
male oral 392
male insulin 323
female diet 147
female oral 435
female insulin 256
run;
title 'Gender, Treatment Relationships and Independence';
proc freq;
tables gender*trt/chisq alpha=0.05;
weight count;
run;
/* The null hypothesis H(0) is 'Gender and Treatment Regimen are independent.'
State the alternative hypothesis.
What is the test statistic (chi-squared)?
What is the critical value and decision rule?
Do we reject the null hypothesis in this case?
Is there a relationship between gender and treatment type?
*/