Compare the risk

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Compare the risk

kiotoqq
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?



Reply | Threaded
Open this post in threaded view
|

Re: Compare the risk

David Winsemius

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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Compare the risk

kiotoqq
thank you......

but it says "dfrm not found"

(sorry, I'm just very new here....)
Reply | Threaded
Open this post in threaded view
|

Re: Compare the risk

David Winsemius

On Jan 7, 2011, at 5:28 PM, kiotoqq wrote:

>
> thank you......
>
> but it says "dfrm not found"

Of course it says, "dfrm not found". That's because it's on _my_  
workspace. You did not say what you were calling your dataframe and I  
cannot read your mind. I had to make up some name, and the chances  
that I would call it the same name as you did are pretty small.

--

David Winsemius, MD
West Hartford, CT

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Compare the risk

kiotoqq
thanks a lot! I got it!