Re: [R] epi.2by2

From: peter dalgaard <pdalgd_at_gmail.com>
Date: Tue, 17 May 2011 14:02:05 +0200

On May 17, 2011, at 12:57 , pcc wrote:

> This is a really simple question, I'm sure,but I can't make EpiR work!
> I keep getting the following:
>

>> epi.2by2(47, 263483, 282, 935028, method="cohort.time", conf.level=0.95)

> Error in epi.2by2(47, 263483, 282, 935028, method = "cohort.time",
> conf.level = 0.95) :
> unused argument(s) (935028)
>
> and I really don't know why!. Any ideas very very welcome
> thank you

If all else fails, try reading the manual.... For the right version, mind you.

Apparently, the formal arguments got changed so that it is now

> args(epi.2by2)

function (dat, method = "cohort.count", conf.level = 0.95, units = 100,

    verbose = FALSE)
NULL with dat an 'object of class "table"'. It seems that a simple matrix will do, though:

> epi.2by2(matrix(c(47, 263483, 282, 935028),2), method="cohort.time", conf.level=0.95)

             Disease +    Time at risk        Inc rate *
Exposed +           47             282              16.7
Exposed -       263483          935028              28.2
Total           263530          935310              28.2

Point estimates and 95 % CIs:


Inc rate ratio                           0.59 (0.43, 0.79)
Attrib rate *                            -11.51 (-16.28, -6.75)
Attrib rate in population *              0 (-0.16, 0.15)
Attrib fraction in exposed (%)           -69.07 (-130.11, -27.14)
Attrib fraction in population (%)        -0.01 (-0.01, -0.01)
---------------------------------------------------------

(presumably you really want the transpose)

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes_at_cbs.dk  Priv: PDalgd_at_gmail.com

______________________________________________
R-help_at_r-project.org 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.
Received on Tue 17 May 2011 - 12:04:17 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 17 May 2011 - 15:15:07 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive