群馬大学 | 医学部 | サイトトップ | 医学情報処理演習

医学情報処理演習:2010年度第9回課題

第9回に出てきた関数と文の主なものはこちらを参照されたい。

課題

http://phi.med.gunma-u.ac.jp/medstat/sample02.txtは,ソロモン諸島の首都のとある学校で実施した健診結果を,昨年の実習で入力してもらった後にエラーを訂正したタブ区切りテキスト形式データである。このデータを読み込んで,蚊帳を毎日使う人(変数BEDNETの値が1である人)の割合が男女(変数SEX)間で差が無いという帰無仮説について,有意水準5%で比率の差の検定をするコードと検定結果と解釈を示す。空白を埋めよ。

(http://phi.med.gunma-u.ac.jp/medstat/sample02.txt is the tab-delimited text file, which is the result of health check in the capital city of Solomon Islands. We have read this data to R, and tested the null-hypothesis that the proportions of using bednet everyday (variable BEDNET's value is 1) are not different between males and females (which is given as the variable SEX), with significance level being 0.05. The code and result with its interpretation are shown below.)

学籍番号・氏名とともに,下のフォームと解釈文を穴埋めして送信せよ。

(Please write the registry number and name, fill the boxes by adequate characters.)


コードは以下の通り。

(The code is shown below.)

x <- read.delim("http://phi.med.gunma-u.ac.jp/medstat/sample02.txt") # read data into x
TOTALBYSEX <- as.vector(Box A(~Box B, data=x)) # calculate numbers by sex as a vector
NETUSERBYSEX <- as.vector(Box A(~Box B[Box C==1], data=x))
Box D(NETUSERBYSEX, TOTALBYSEX) # test the equality of proportios

得られる結果は以下の通り。

(The result is shown below.)

        2-sample test for equality of proportions with continuity correction

data:  NETUSERBYSEX out of TOTALBYSEX 
X-squared = 4.5017, df = 1, p-value = 0.03386
alternative hypothesis: two.sided 
95 percent confidence interval:
 -0.50815084 -0.05477823 
sample estimates:
    prop 1     prop 2 
0.08695652 0.36842105 

計算途中で生成したベクトルNETUSERBYSEXは,FがMよりアルファベットで早いので,最初の要素が女性の人数,2番目の要素が男性の人数となる。従って,結果で得られたprop 1の値0.087は女性(F)の中で毎日蚊帳を使う人(BEDNETの値が1)の割合であり,prop 2の値0.368は男性(M)の中で毎日蚊帳を使う人(BEDNETの値が1)の割合である。有意確率がBox Eと5%より小さいので,毎日蚊帳を使う人の割合には有意水準5%で統計学的に有意な性差があったといえる。

(The vector NETUSERBYSEX is composed of the first element as number of females and the second element as number of males because F is earlier than M in alphabetical order. Thus the prop 1's value 0.087 is the proportion of everyday bednet user (BEDNET's value is 1) in females (F) and the prop 2's value 0.368 is the proportion of everyday bednet user in males (M). The significant probability was Box E, which is less than 0.05. Therefore, we can say that there is statistically significant difference in the porportion of everyday bednet user in males and females at 5% level.)

解答フォーム (Answer form)

項目入力欄
学籍番号(数字のみ,半角で)(Reg.No.)
氏名(Name)
Box A
Box B
Box C
Box D
Box E
感想・要望・質問など(Comments)


リンクと引用について