본문내용
proc format;
value f_region 1=\'대도시\' 2=\'중소도시\' 3=\'도시 이외 지역\';
value f_type 1=\'살인\' 2=\'강도\' 3=\'강간\';
run;
data ex9_3;
input region type count @@;
cards;
1 1 28 1 2 38 1 3 24 2 1 74 2 2 84 2 3 34 3 1 64 3 2 34 3 3 20
;
run;
proc print data=ex9_3;
format region f_region. type f_type.;
run;
proc freq data=ex9_3;
weight count;
tables region*type / chisq all;
run;
1.가설
2.유의수준
3.검정통계량=14.9288
4.기각역 :
5.결과해석 : sas 프로그램 실행 결과의 유의확률은 0.0049로 유의수준=0.05 > 유의확률=0.0049로 기각역에 속하므로 유의수준 5%에서 귀무가설을 기각할 수 있다. 따라서 범죄의 종류와 발생지역 사이에 관계가 있다고 할 수 있다.
sas의 cinv()함수를 이용하여 카이제곱검정통계량의 기각치 를 얻을 수 있다. 이때 이므로 유의수준 5%에서 귀무가설을 기각할 수 있다. 즉, 범죄의 종류와 발생지역 사이에 관계가 있다고 할 수 있다.
9.4
proc format;
value f_heart 1=\'있음\' 2=\'없음\';
value f_tension 1=\'항상 긴장함\' 2=\'가끔 긴장함\' 3=\'긴장하지 않음\';
run;
data ex9_4;
input heart tension count @@;
format heart f_heart. tension f_tension.;
cards;
1 1 51 1 2 72 1 3 19 2 1 89 2 2 280 2 3 89
;
run;
proc print data=ex9_4;
run;
proc freq data=ex9_4;
weight count;
tables heart*tension / chisq all;
run;
1.가설
2.유의수준
3.검정통계량=16.8374
4.기각역 :
5.결과해석 : sas 프로그램 실행 결과의 유의확률은 0.0002로 유의수준=0.05 > 유의확률=0.0002로 기각역에 속하므로 유의수준 5%에서 귀무가설을 기각할 수 있다. 따라서 긴장도와 심장병 사이에 관계가 있다고 할 수 있다.
sas의 cinv()함수를 이용하여 카이제곱검정통계량의 기각치 를 얻을 수 있다. 이때 이므로 유의수준 5%에서 귀무가설을 기각할 수 있다. 즉, 긴장도와 심장병 사이에 관계가 있다고 할 수 있다.
9.5
proc format;
value f_interest 1=\'찬성\' 2=\'무관심\' 3=\'반대\';
value f_gender 1=\'남학생\' 2=\'여학생\';
run;
data ex9_5;
input interest gender count @@;
format interest f_interest. gender f_gender.;
cards;
1 1 93 1 2 55 2 1 72 2 2 79 3 1 21 3 2 30
;
run;
proc print data=ex9_5;
run;
proc freq data=ex9_5;
weight count;
tables gender*interest / chisq ;
run;
1.가설
2.유의수준
3.검정통계량=10.3274
4.기각역 :
5.결과해석 : sas 프로그램 실행 결과의 유의확률은 0.0057으로 유의수준=0.05 > 유의확률=0.0057으로 기각역에 속하므로 유의수준 5%에서 귀무가설을 기각할 수 있다. 따라서 남학생과 여학생의 호응이 다르다고 할 수 있다.
9.6
proc format;
value f_year 1=\'1985년\' 2=\'1990년\' 3=\'1995년\';
value f_opinion 1=\'지지함\' 2=\'지지하지 않음\';
data ex9_6;
input year opinion count @@;
format year f_year. opinion f_opinion.;
cards;
1 1 410 1 2 252 2 1 412 2 2 176 3 1 409 3 2 151
;
run;
proc print data=ex9_6;
format year f_year. opinion f_opinion.;
run;
proc freq data=ex9_6;
weight count;
tables opinion*year / chisq ;
run;
1.가설
2.유의수준
3.검정통계량=18.8813
4.기각역 :
5.결과해석 : sas 프로그램 실행 결과의 유의확률은 <0.0001으로 유의수준=0.05 > 유의확률으로 기각역에 속하므로 유의수준 5%에서 귀무가설을 기각할 수 있다. 따라서 관측된 3개년도 간에 지지도에 차이가 있다고 할 수 있다.
9.7
(1)
proc freq data=ds;
tables gender*age;
run;
(2)
proc freq data=save.ds;
tables age*residence;
run;
(3)
proc freq data=save.ds;
tables gender*age*residence;
run;
(4)
proc freq data=save.ds;
tables gender*q11 / chisq ;
run;
1.가설
2.유의수준
3.검정통계량=1.6209
4.기각역 :
5.결과해석 : sas 프로그램 실행 결과의 유의확률은 0.8050으로 유의수준=0.05 < 유의확률=0.8050으로 기각역에 속하지 않으므로 유의수준 5%에서 귀무가설을 기각할 수 없다. 따라서 성별에 따라 만족도의 값이 차이가 없다고 할 수 있다.
(5)
proc freq data=save.ds;
tables age*q11 / chisq ;
run;
1.가설
2.유의수준
3.검정통계량=149.62330
4.기각역 :
5.결과해석 : sas 프로그램 실행 결과의 유의확률은 <0.0001으로 유의수준=0.05 > 유의확률로 기각역에 속하므로 유의수준 5%에서 귀무가설을 기각할 수 있다. 따라서 나이에 따라 만족도의 값이 차이가 있다고 할 수 있다.
value f_region 1=\'대도시\' 2=\'중소도시\' 3=\'도시 이외 지역\';
value f_type 1=\'살인\' 2=\'강도\' 3=\'강간\';
run;
data ex9_3;
input region type count @@;
cards;
1 1 28 1 2 38 1 3 24 2 1 74 2 2 84 2 3 34 3 1 64 3 2 34 3 3 20
;
run;
proc print data=ex9_3;
format region f_region. type f_type.;
run;
proc freq data=ex9_3;
weight count;
tables region*type / chisq all;
run;
1.가설
2.유의수준
3.검정통계량=14.9288
4.기각역 :
5.결과해석 : sas 프로그램 실행 결과의 유의확률은 0.0049로 유의수준=0.05 > 유의확률=0.0049로 기각역에 속하므로 유의수준 5%에서 귀무가설을 기각할 수 있다. 따라서 범죄의 종류와 발생지역 사이에 관계가 있다고 할 수 있다.
sas의 cinv()함수를 이용하여 카이제곱검정통계량의 기각치 를 얻을 수 있다. 이때 이므로 유의수준 5%에서 귀무가설을 기각할 수 있다. 즉, 범죄의 종류와 발생지역 사이에 관계가 있다고 할 수 있다.
9.4
proc format;
value f_heart 1=\'있음\' 2=\'없음\';
value f_tension 1=\'항상 긴장함\' 2=\'가끔 긴장함\' 3=\'긴장하지 않음\';
run;
data ex9_4;
input heart tension count @@;
format heart f_heart. tension f_tension.;
cards;
1 1 51 1 2 72 1 3 19 2 1 89 2 2 280 2 3 89
;
run;
proc print data=ex9_4;
run;
proc freq data=ex9_4;
weight count;
tables heart*tension / chisq all;
run;
1.가설
2.유의수준
3.검정통계량=16.8374
4.기각역 :
5.결과해석 : sas 프로그램 실행 결과의 유의확률은 0.0002로 유의수준=0.05 > 유의확률=0.0002로 기각역에 속하므로 유의수준 5%에서 귀무가설을 기각할 수 있다. 따라서 긴장도와 심장병 사이에 관계가 있다고 할 수 있다.
sas의 cinv()함수를 이용하여 카이제곱검정통계량의 기각치 를 얻을 수 있다. 이때 이므로 유의수준 5%에서 귀무가설을 기각할 수 있다. 즉, 긴장도와 심장병 사이에 관계가 있다고 할 수 있다.
9.5
proc format;
value f_interest 1=\'찬성\' 2=\'무관심\' 3=\'반대\';
value f_gender 1=\'남학생\' 2=\'여학생\';
run;
data ex9_5;
input interest gender count @@;
format interest f_interest. gender f_gender.;
cards;
1 1 93 1 2 55 2 1 72 2 2 79 3 1 21 3 2 30
;
run;
proc print data=ex9_5;
run;
proc freq data=ex9_5;
weight count;
tables gender*interest / chisq ;
run;
1.가설
2.유의수준
3.검정통계량=10.3274
4.기각역 :
5.결과해석 : sas 프로그램 실행 결과의 유의확률은 0.0057으로 유의수준=0.05 > 유의확률=0.0057으로 기각역에 속하므로 유의수준 5%에서 귀무가설을 기각할 수 있다. 따라서 남학생과 여학생의 호응이 다르다고 할 수 있다.
9.6
proc format;
value f_year 1=\'1985년\' 2=\'1990년\' 3=\'1995년\';
value f_opinion 1=\'지지함\' 2=\'지지하지 않음\';
data ex9_6;
input year opinion count @@;
format year f_year. opinion f_opinion.;
cards;
1 1 410 1 2 252 2 1 412 2 2 176 3 1 409 3 2 151
;
run;
proc print data=ex9_6;
format year f_year. opinion f_opinion.;
run;
proc freq data=ex9_6;
weight count;
tables opinion*year / chisq ;
run;
1.가설
2.유의수준
3.검정통계량=18.8813
4.기각역 :
5.결과해석 : sas 프로그램 실행 결과의 유의확률은 <0.0001으로 유의수준=0.05 > 유의확률으로 기각역에 속하므로 유의수준 5%에서 귀무가설을 기각할 수 있다. 따라서 관측된 3개년도 간에 지지도에 차이가 있다고 할 수 있다.
9.7
(1)
proc freq data=ds;
tables gender*age;
run;
(2)
proc freq data=save.ds;
tables age*residence;
run;
(3)
proc freq data=save.ds;
tables gender*age*residence;
run;
(4)
proc freq data=save.ds;
tables gender*q11 / chisq ;
run;
1.가설
2.유의수준
3.검정통계량=1.6209
4.기각역 :
5.결과해석 : sas 프로그램 실행 결과의 유의확률은 0.8050으로 유의수준=0.05 < 유의확률=0.8050으로 기각역에 속하지 않으므로 유의수준 5%에서 귀무가설을 기각할 수 없다. 따라서 성별에 따라 만족도의 값이 차이가 없다고 할 수 있다.
(5)
proc freq data=save.ds;
tables age*q11 / chisq ;
run;
1.가설
2.유의수준
3.검정통계량=149.62330
4.기각역 :
5.결과해석 : sas 프로그램 실행 결과의 유의확률은 <0.0001으로 유의수준=0.05 > 유의확률로 기각역에 속하므로 유의수준 5%에서 귀무가설을 기각할 수 있다. 따라서 나이에 따라 만족도의 값이 차이가 있다고 할 수 있다.
소개글