[R] epi.2by2
peter dalgaard
pdalgd at gmail.com
Tue May 17 14:02:05 CEST 2011
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)
---------------------------------------------------------
* Cases per 100 units of population time at risk
(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
More information about the R-help
mailing list