I have created a function in R "EffectSize" which gives me a table of data when I run it.
i.e.
EffectSize=function(data,conf.level,statistic){
...
}
and running
EffectSize(epidural, 0.95, "OR")
I get:
Author OR ln(OR) Var ln(OR) 95% CI
1 A 0.894 -0.112 0.309967 (0.3001, 2.6611)
2 B 0.908 -0.097 0.064500 (0.5519, 1.4934)
3 C 0.824 -0.194 2.130252 (0.0471, 14.3893)
4 D 0.874 -0.135 0.015054 (0.6871, 1.1115)
5 E 0.764 -0.269 0.021964 (0.5712, 1.0212)
6 F 0.328 -1.116 0.415859 (0.0926, 1.1599)
Now I want to create another function which uses values from this table.
I want the function to be structured in the same way so that it is:
InVar=function(data,conf.level,statistic){
...
}
Just as a bit of background to the problem, I want that
weight=1/varodds
muhat=sum(weight*logodds)/sum(weight)
varmuhat=1/sum(weight)
To achieve this I have tried to do things like
InVar=function(data,conf.level,statistic){
weight=1/EffectSize[,4]
...
}
but I am not getting any luck.
I hope I have explained the kind of thing I am after well enough and would appreciate any help you can offer.
Many thanks