[R] Compare the risk

David Winsemius dwinsemius at comcast.net
Fri Jan 7 22:39:23 CET 2011


On Jan 7, 2011, at 1:58 PM, kiotoqq wrote:

>
> I have a dataset which looks like this:
>
>     cbr  dust smoking expo
> 1      0  0.20       1    5
> 2      0  0.25       1    4
> 3      0  0.25       1    8
> 4      0  0.25       1    4
> 5      0  0.25       1    4
> 6      0  0.25       1    8
> 7      0  0.25       1    8
> 8      0  0.25       1    4
> 9      1  0.25       1    8
> 10     0  0.29       1    7
> 11     0  0.29       0    7
> 12     0  0.29       1    7
> 13     0  0.30       0   10
> 14     0  0.30       1   10
> 15
> 16
> .
> .
> .
>
>
> How can I compare the risk of getting bronchitis between smoker and
> no-smoker?

cbrsmk.tbl <- with(dfrm, table(cbr, smoking) )
cbrsmk.tbl
cbrsmk.tbl[2, ]/(cbrsmk.tbl[1, ]+cbrsmk.tbl[2, ])

(That homework set must be going awfully slowly.)

-- 

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list