The constraint b1=b2 in a model such as b0 + b1 x1 + b2 x2 + b3 x3 implies that
b0 + b1 (x1 + x2) + b3 x3, so just add x1 and x2 (call this x12) and fit the
model b0 + b1 x12 + b3 x3 and you have imposed the constraint that b1=b2. To
impose the constraint that b3=0, just fit the model without
I am not aware of the existance of a shortcut that would do what you describe.
On Windows, one could hit Ctrl-M, followed by R, but then one gets a prompt,
asking for confirmation to remove all objects, but this can't be what you are
referring to.
Are you perhaps using Tinn-R and
Dear Scott,
The short answer is: No, this is not possible.
The longer answer is: In principle, this will be possible in the future. I am
working on functions for the metafor package for multivariate meta-analyses
(i.e., where we no longer assume that the observed outcomes or effect size
It's implemented in the metafor package.
Using the example from the pdf that Marc pointed out:
library(metafor)
ai - c(53, 121, 95, 103, 64, 7, 0)
bi - c(2, 3, 14, 27, 51, 29, 13)
ci - c(61, 152, 114, 66, 81, 28, 0)
di - c(1, 5, 7, 12,
I believe nobody has responded to far, so maybe this is not a wide-spread
issue. However, I have also encountered this since upgrading to R 2.12.0
(Windows 7, 64-bit). In my simulations where I use txtProgressBar(), the
problem usually disappears after the bar has progressed to a certain
:
Maastricht University, P.O. Box 616 Room B2.01 (second floor)
6200 MD Maastricht, The Netherlands Debyeplein 1 (Randwyck)
Original Message
From: Angelo Franchini [mailto:angelo.franch...@bristol.ac.uk]
Sent: Wednesday, August 04, 2010 16:26
To: Viechtbauer Wolfgang (STAT)
Cc
Correct.
--
Wolfgang Viechtbauerhttp://www.wvbauer.com/
Department of Methodology and StatisticsTel: +31 (0)43 388-2277
School for Public Health and Primary Care Office Location:
Maastricht University, P.O. Box 616 Room B2.01 (second floor)
6200 MD
Room B2.01 (second floor)
6200 MD Maastricht, The Netherlands Debyeplein 1 (Randwyck)
Original Message
From: Angelo Franchini [mailto:angelo.franch...@bristol.ac.uk]
Sent: Sunday, August 08, 2010 13:09
To: Viechtbauer Wolfgang (STAT)
Cc: r-help@r-project.org
Subject: RE: [R
If the sampling variances are known up to a proportionality constant, then you
can use:
weights = varFixed(~ vi)
where vi is the vector of the 50 sampling variances (corresponding to the 50
values of the dependent variable). You may have to create the vi vector by
repeating the 5 sampling
I do not know about the details of the model, but the results are not all that
strange. I'll assume that you are using family=gaussian(), so you are
essentially running a model where (Intercept) reflects the mean of the
dependent variable for that third category (MagMid) of the Mag factor and
Debyeplein 1 (Randwyck)
Original Message
From: Chris Mcowen [mailto:sam_sm...@me.com]
Sent: Wednesday, October 06, 2010 16:38
To: Viechtbauer Wolfgang (STAT)
Cc: r-help@r-project.org
Subject: Re: [R] Highly significant intercept and large standard error
Hi Wolfgang,
Thanks
I think it's useful to realize that this approach still implies that the
\phi_{i}'s are entered as fixed effects into the model (as opposed to treating
the \phi_{i}'s as random effects); it's just that the iterative algorithm to
obtain the maximum likelihood estimates is faster when using
There is the 'sem' package:
http://cran.r-project.org/web/packages/sem/index.html
The task views (http://cran.r-project.org/web/views/) are often a good place to
start when looking for particular techniques/methods.
Best,
--
Wolfgang Viechtbauerhttp://www.wvbauer.com/
tapply(x, y, min)
where x is the vector of numbers and y the vector of class labels.
Best,
--
Wolfgang Viechtbauerhttp://www.wvbauer.com/
Department of Methodology and StatisticsTel: +31 (0)43 388-2277
School for Public Health and Primary Care Office Location:
Not sure what you mean.
yi - c(2,3,2,4,3,6)
xi - c(1,4,3,2,4,5)
res - lm(yi ~ xi)
hatvalues(res)
X - cbind(1, xi)
diag( X%*%solve(t(X)%*%X)%*%t(X) )
Same result.
Best,
--
Wolfgang Viechtbauerhttp://www.wvbauer.com/
Department of Methodology and StatisticsTel: +31
Try this:
Instead of:
theta = c()
use:
theta - rep(NA, 50)
or however many iterations you want the algorithm to run.
Best,
--
Wolfgang Viechtbauerhttp://www.wvbauer.com/
Department of Methodology and StatisticsTel: +31 (0)43 388-2277
School for Public Health
The way you have specified the model implies that the covariance is 0.
If you actually want to estimate the covariance, you need to use:
fm1 - lmer(fpg ~ 1 + time + (time|ID), fpg_lme)
Best,
--
Wolfgang Viechtbauerhttp://www.wvbauer.com/
Department of Methodology and
Dear Antonio,
Yes, I am currently working on these extensions. It will take some time before
those functions are sufficiently tested and documented and can become part of
the metafor package. My goal is to do so within the next year, but I cannot
give any specific date for when this will be
No idea if this helps, but if the optimizer (nlminb) is giving you problems,
you could try switching to another optimizer (nlm) with:
control=list(opt=nlm)
Best,
--
Wolfgang Viechtbauerhttp://www.wvbauer.com/
Department of Methodology and StatisticsTel: +31 (43)
Dear All,
Suppose I want to write a method for the generic function confint():
args(confint)
function (object, parm, level = 0.95, ...)
So, it looks like the second and third argument have been predefined in the
generic function. Suppose one or several of the predefined arguments don't
apply
A similar problem was mentioned before:
https://stat.ethz.ch/pipermail/r-sig-mixed-models/2008q3/001425.html
There appears to be a bug in the C code leading to memory corruption.
Best,
--
Wolfgang Viechtbauerhttp://www.wvbauer.com/
Department of Methodology and
The model you have specified there is not an ordinary factor analysis model.
This may be closer to what you are thinking of:
model.RLIM - specify.model()
f1 - R, laddR, NA
f1 - L, laddL, NA
f1 - I, laddI, NA
f1 - M, laddM, NA
R - R, dR, NA
L - L, dL, NA
Dear Sebastian,
Glad to hear you find the package useful.
Before I get to your questions, just as an aside - you can leave default
arguments out of the call. So:
MAergebnis-rma.uni(ri=PosOutc, ni=N, data=dm,
slab=c(dm$Article, dm$StudyNo), measure=ZCOR, method=DL)
would do exactly the same as
The figure that you linked to was produced with the metafor package. It can
also be used to produce a forest plot if you have means and corresponding
standard errors of the means. The standard error of a mean is equal to SD /
sqrt(n), so as long as you also know the sample sizes (n), you can
Debyeplein 1 (Randwyck)
Original Message
From: Xin Ge [mailto:xingemaill...@gmail.com]
Sent: Sunday, December 06, 2009 00:40
To: Viechtbauer Wolfgang (STAT)
Cc: r-help@r-project.org
Subject: Re: [R] Forest Plot
Thanks for your reply. Which function I should explore in metafor
package
If you have the bounds of a 95% CI in the form of:
exponential(estimate +/- 1.96*SE)
then it is easy to get the SE back:
SE = (log(UL) - log(LL)) / (2*1.96)
Then supply the estimates and the SEs to the forest() function:
forest(estimate, sei=SE)
You can use:
forest(estimate, sei=SE,
Dear Joris,
When you call rma() with the (default) argument intercept=TRUE, then the
intercept is added to the X matrix (a column of 1s is added). So, if you use:
fac - c(1,1,2,3,3,4,4,5,5,5)
X - model.matrix(~factor(fac))[,2:5]
and then:
rma(ai, bi, ci, di, mods=X, data=testdata, measure=OR)
Dear All,
I have a question about formulas and model.matrix(). If one specifies a model
via a formula, the corresponding design matrix can be obtained with the
model.matrix() function. For example:
x1 - c(1,4,2,3,5)
x2 - c(1,1,2,2,2)
myformula - ~ x1 + factor(x2)
model.matrix(myformula)
My
Dear Chris,
Just define the following function:
transf.iasin - function(x) {
z - sin(x)^2
return(z)
}
to give the inverse of the arcsine transformation. Then specify this function
under the atransf argument.
I will add the transf.iasin() function to the package.
Best,
--
Wolfgang
Dear Gerrit,
the most appropriate approach for data of this type would be a proper
multivariate meta-analytic model (along the lines of Kalaian Raudenbush,
1996). Since you do not know the correlations of the reaction time measurements
across conditions for the within-subject designs, a
The weights in 'aa' are the inverse standard deviations. But you want to use
the inverse variances as the weights:
aa - (attributes(summary(f1)$modelStruct$varStruct)$weights)^2
And then the results are essentially identical.
Best,
--
Wolfgang Viechtbauer
With appropriate design matrix, I mean the X matrix in the mixed-effects
model y = Xb + u + e, where y is the vector of outcomes, u is a vector of
(possibly correlated) random effects, and e is a vector of (possibly) random
errors. The X matrix is specified via the 'mods' argument in the rma()
The problem I see here is not so much the 27136 observations, but the fact that
the first two factors have up to 101 different levels and the third factor up
to 1001 different levels. That means that lm() is essentially creating
100+100+1000 dummies for those factors, leading to a large (and
Just as an aside, the scatterplot3d package does things like this very
cleverly. Essentially, when you create a plot with scatterplot3d, the function
actually returns functions with values set so that points3d(), for example,
knows the axis scaling.
Best,
--
Wolfgang Viechtbauer
Hello Gang,
Mike has already given you some excellent advice and references. I just want to
add some information about the metafor package.
To be precise, the meta-analytic mixed-effects model is given by:
y_i = X_i * beta_i + u_i + e_i
where X_i and beta_i have the usual interpretation, u_i
I don't think this information can be found in the documentation, but you can
always just check the actual influence.measures() and print.infl() code to find
out. Most importantly, influence.measures() incldues the following code:
function (model)
{
is.influential - function(infmat, n) {
Try multiplying var(e) by n-1 and dividing by n-3 (97 are the degrees of
freedom for the sum of squares error in your example). Then it all matches up
nicely.
Best,
--
Wolfgang Viechtbauer
Department of Methodology and Statistics
University of Maastricht, The Netherlands
Dear All,
I am working on a function that has an optional data argument, just like lm().
If the user sets the data argument equal to some dataframe, then the function
should look inside the dataframe for the variables given to other arguments,
otherwise the variables should be accessible from
Are n.FD and n.RD the number of people who received the full/reduced dose and
surv.FD and surv.RD the number of people that survived? And are the people who
received the full dose different from the people who received the reduced dose?
And what exactly is it that you want to plot in the forest
Dear All,
A while back, the question was raised whether R would run on an Eee PC:
http://tolstoy.newcastle.edu.au/R/e3/help/07/12/6564.html
There were some positive responses and some suggestions for getting this to
work:
http://tolstoy.newcastle.edu.au/R/e3/help/07/12/7244.html
For those
Hello Jan,
As far as know, fixing sigma to 1 is not possible in R with lme. That is
why I started to write my own functions to allow me to fit mixed-effects
models in R. Quite some time ago, I put one of those functions on my
website, which can be downloaded here:
A new package is now available via CRAN, called metafor.
The metafor package consists of a collection of functions for conducting
meta-analyses in R. Fixed- and random-effects models (with and without
moderators) can be fitted via the general linear (mixed-effects) model. For 2x2
table data,
Don't worry Emmanuel, not even people in Germany can figure out how exactly my
last name is spelled =)
I am actually getting quite close to finishing and releasing a first version of
the package. The mima function will become obsolete at that point.
Regarding the original post -- I am not
Some useful comments have already been made. I would like to comment on
the two definitions of the p-value under (4) -- since I thought exactly
about this issue a while back. Maybe this will be useful ...
Suppose the distribution of a test statistic Z under H0 is given by f(Z)
and that the
Correct, it is not possible to fix the residual variance to 1 in the R version
of lme(), which is what one (typically) wants to do in meta-analyses, where the
sampling variances are assumed to be (approximately) known. This is however
possible in S-Plus, if you have access to that. Adding:
Are the two models (f1 and f2) actually nested?
Aside from that, it is strange that the output is exactly the same after you
used REML=FALSE. The log likelihoods should have changed.
Best,
--
Wolfgang Viechtbauer
Department of Methodology and Statistics
School for Public Health and Primary
Hi Sebastian,
Here is an example showing a forest plot with some column headings:
library(metafor)
data(dat.bcg)
dat - dat.bcg
res - rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat, measure=RR)
windows(width=6.5,
I know nothing about the biological background here, but I also wonder if the
standard meta-analytic approach is meaningful here. I also see some confusion
in terminology (these are not count data!).
There appear to be only 3 observations per group in each of the studies -- the
standard
Dear Jokel,
Right now, none of the functions return that information. But it's easy to
calculate those CIs by hand (simply take yi +- 1.96 sqrt(vi) and apply, if
needed, some appropriate transformation). For example:
data(dat.bcg)
dat - escalc(measure=RR, ai=tpos, bi=tneg, ci=cpos, di=cneg,
And at that point, one is essentially doing a meta-analysis. For example:
library(metafor)
ri - c(.5, .4)
ni - c(40, 25)
res - rma(ri=ri, ni=ni, measure=ZCOR, method=FE)
predict(res, transf=transf.ztor, digits=2)
pred se ci.lb ci.ub
0.46 NA 0.24 0.64
You also get the CI (in addition to
Dear Jokel,
Unfortunately, this won't work. The derivation of the equation given in the
Handbook shows why this is so. First of all, note that
d = (m1 - m2) / sp,
where m1 and m2 are the means of the two groups and sp is the pooled SD. The
two independent samples t-test (assuming
Dear Jokel,
If a moderator has 4 levels, then you need 3 dummy variables (one of the levels
will become your reference level, so you do not need a dummy for that one).
You can do the dummy-coding yourself or let R handle it. For example, if the
moderator is called catmod, then:
rma(yi, vi,
Dear Emilie,
Regarding your questions:
1) It's not the weighting that is the main issue when you do not have the SDs.
The problem is that you need the SDs to calculate the sampling variances of the
mean differences (I assume that this is your outcome measure for the
meta-analysis). Those are
Actually, Scott suggested ggplot2, which is available on CRAN:
http://cran.r-project.org/web/packages/ggplot2/index.html
Moreover, for the metafor package, you do not need (a,b,c,d) or standard
errors for the effect estimates.
rr - c(0.61, 0.35, 1.16, 0.94, 1.16, 0.46, 0.99, 1.05, 1.15, 0.27)
To: Viechtbauer Wolfgang (STAT)
Cc: R-help@r-project.org
Subject: Re: [R] metaplot
Thank you for your reply.
forest(log(rr), ci.lbhttp://ci.lb=lci, ci.ub=uci, xlab=Log Relative Risk)
Error in sei^2 : 'sei' is missing
Regards,
Cheba
2011/4/7 Viechtbauer Wolfgang (STAT)
wolfgang.viechtba
It is not clear (at least to me) what exactly you want. You want two forest
plots in one graph but apparently not side-by-side or one on top and the
other on the bottom. So, you want to superimpose them? How do you want to do
that without creating an illegible mess? Or do you want one graph,
...@stat.math.ethz.ch; Viechtbauer Wolfgang (STAT)
Subject: RE: [R] forest + igraph ?
Thank you for your reply. I would like to have two forest plots one on top
and the other on the bottom. I am using R version 2.12.2 (32-bit) Windows.
The code you sent me still plotting two windows one after the other
616
6200 MD Maastricht, The Netherlands
Tel: +31 (43) 368-5248
Fax: +31 (43) 368-8689
Web: http://www.wvbauer.com
-Original Message-
From: Samor Gandhi [mailto:samorgan...@yahoo.com]
Sent: Tuesday, April 12, 2011 15:59
To: r-h...@stat.math.ethz.ch; Viechtbauer Wolfgang (STAT
We do not know the details of the kinds of computations you intend to do within
each iteration, but if, let's say, each iterations takes around 1 second, then
your simulation will run for the next 30+ years (on a single core). Even if
each iteration only takes a fraction of a second, you are
Thank you, Bernd, for looking into this.
Yes, at the moment, the color of the summary estimate for models without
moderators is hard-coded (as black). I didn't think people may want to change
that. I guess I was wrong =)
A dirty solution for the moment is to add:
addpoly(dfs, efac=6, row=-1,
...@gmail.com]
Sent: Thursday, August 25, 2011 10:57
To: Viechtbauer Wolfgang (STAT)
Cc: r-help@r-project.org; Bernd Weiss
Subject: Re: [R] Change color in forest.rma (metafor)
Thank you for your attention and help!
In this way I get the diamond coloured, but actually I would have the
squares
Another way would be to consider this as a path model and use the sem or lavaan
package to fit this model. Here is an example:
x - rnorm(1000)
e1 - rnorm(1000)
e2 - e1 + rnorm(1000)
e1 - e1 + rnorm(1000)
y1 - 2 + 1*x + e1
y2 - 4 + 2*x + e2
dat - data.frame(x, y1, y2)
model - 'y1 ~ x
See ?par and its mar argument.
Could you tell me also how to change the size of the chart? There is not
enough space below the chart to add the arrows!
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read
Acutally,
?mcnemar.test
since it is paired data.
Best,
Wolfgang
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Bert Gunter
Sent: Wednesday, September 07, 2011 15:34
To: John Sorkin
Cc: r-help@r-project.org
Subject: Re:
, 2011 16:47
To: Viechtbauer Wolfgang (STAT)
Cc: r-help@r-project.org; John Sorkin
Subject: Re: [R] suggestion for proportions
Wolfgang:
On Wed, Sep 7, 2011 at 7:28 AM, Viechtbauer Wolfgang (STAT)
wolfgang.viechtba...@maastrichtuniversity.nl wrote:
Acutally,
?mcnemar.test
since
I assume you mean Cohen's kappa. This is not what the OP is asking about. The
OP wants to know how to test for a difference in the proportions of 1's.
Cohen's kappa will tell you what the level of agreement is between the two
tests. This is something different.
Also, the OP has now clarified
Hello Andrew,
Take a look at the following:
predict(model1, addx=T)
predict(model2, addx=T)
predict(model3, addx=T)
As you can see, the factor was turned into dummy variables. However, the
predict.rma() function does not expand a factor passed via newmods into the
corresponding dummy
Dear Faiz,
in principle, you can include whatever moderators you want in a meta-regression
model. A technical issue here is that the two follow-up variables are probably
strongly correlated, so this may create issues with the model fitting and it
also complicates the interpretation of the
To add to Michael's response:
There are several things you can do:
1) If the dependent variable is the same in each study, then you could conduct
the meta-analysis with the (raw) mean changes, i.e., yi = m1i - m2i, where m1i
and m2i are the means at time 1 and 2, respectively. The sampling
I do not see any major difficulties with this case either. Suppose you have OR
= 1.5 (with 95% CI: 1.19 to 1.90) indicating that the odds of a particular
outcome (e.g., disease) is 1.5 times greater when the (continuous) exposure
variable increases by one unit. Then you can back-calculate the
...@gmail.com [mailto:mp.sylves...@gmail.com]
Sent: Thursday, April 05, 2012 15:23
To: Viechtbauer Wolfgang (STAT); Marie-Pierre Sylvestre
Cc: r-help@r-project.org; Thomas Lumley
Subject: Re: RE: [R] meta-analysis, outcome = OR associated with a
continuous independent variable
For some reason I
Dear Patricia,
I was recently asked the exact same question, so the answer is yes, but it
takes a little bit of extra work and the newest version of the metafor package
(version 1.5-0, which was submitted to CRAN yesterday and which should
hopefully be ready for download in a few days).
I'll
See FAQ 7.31:
http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f
And try this:
25000*(1-.55) - 11250
25000*.45 - 11250
Notice a difference?
Best,
--
Wolfgang Viechtbauer
Department of Psychiatry and Neuropsychology
School for Mental Health and
Trying to make the fastest referal to FAQ 7.31 is becoming quite a sport around
here. David beat us all to it on this round. Chances are there will be many
more rounds to come.
Best,
Wolfgang
Original Message
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Dear Mario,
1) Whether to use 1/2* or not is arbitary. It's just a multiplicative constant.
2) vi - 1/(4*ni + 2)
If one leave off the 1/2* part, then it would be vi - 1/(ni + 1/2).
3) Yes, but it takes a bit more work. Fortunately, the same issue was raised
not very long ago, so the following
Dear Serge-Étienne,
Try:
res - rma.uni(yi, vi, data=dat, method=DL)
for the random-effects model when using the metafor package. You used
method=HE -- this will give you a different estimator of tau^2 then the one
used in the meta package.
Best,
--
Wolfgang Viechtbauer
Department of
Dear Fernanda,
Currently, there is no option in metafor that will automatically give you
standardized coefficients for meta-regression models. The question is also how
you would like to standardize those coefficients. In the usual regression
models, the standardized coefficients are those that
If b is the coefficient from the meta-regression model that indicates the
(average) change in the outcome measure for a one-unit increase in the
corresponding explanatory variable, then 5*b is the (average) change in the
outcome measure for a 5-unit increase in the explanatory variable.
Or
Essentially, this is a side-by-side forest plot, where the plot on the left is
for sensitivity and the plot on the right is for specificity. For 2x2 table
data from diagnostic studies, it is easy to calculate the sensitivity and
specificity values (and corresponding sampling variances) by hand.
Here is an example. It requires a bit of extra work, but that's the beauty of R
-- you can essentially customize a graph to your taste with low-level
functions. I also added the prediction interval using the addcred argument (as
suggested by Michael), since it gives the same information as that
Yes, I forgot to divide the weights by the sum of the weights (and multiply by
100) for weights.rma.mh(). This bug was pointed out to me a few weeks ago and
this will be changed in the next version of the package.
Best,
Wolfgang
--
Wolfgang Viechtbauer, Ph.D., Statistician
Department of
I do not know how Metawin calculates the confidence interval for the QQ-plot.
The manual lists Chambers, Cleveland, Kleiner, and Tukey (1983) as a reference
for the method used. Not sure whether that is the classical confidence
interval.
The method used in metafor is based on Cook and Weisberg
Dear Holger,
Actually, the omnibus test (QM-test) will give you the same result regardless
of which category you make the reference category (try it out!). So, it will
pick up all of the differences, whether they are to the reference category or
between any of the other categories.
If the
Well, that's a good question. It actually applies to many different contexts
(not just meta-analysis). Think of the ANOVA F-test and post-hoc/planned
contrasts. It's essentially the same situation. And if you would ask 10
different statisticians about this, you may get 11 different answers.
My
As Michael already mentioned, the error:
Error in qr.solve(wX, diag(k)) : singular matrix 'a' in solve
indeed indicates that your design matrix is not of full rank (i.e., there are
linear dependencies among your predictors). With this many factors in the same
model, this is not surprising if k
Hello Christian,
First of all, it's good to see that you are well aware of the fact that lme()
without lmeControl(sigma=1) will lead to the estimation of the residual
variance component, which implies that the sampling variances specified via
varFixed() are only assumed to be known up to a
Dear Alma,
either there is a whole lot of miscommunicaton here, or you (and your
supervisor) are way in over your head.
You say that you are working with Cohen's d values. And you mentioned CMA. So,
let me ask you some questions:
1) Has CMA computed those d values for you?
2) If yes, what
Please see my comments below.
Best,
Wolfgang
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Rachel Slatyer
Sent: Wednesday, February 27, 2013 06:00
To: R-help@r-project.org
Subject: [R] metafor - interpretion of QM in
Absolutely correct. The documentation wasn't clear on that. Changed for the
next version of the package. And the escalc() function now no longer checks for
sd2i, since it is not needed anyway (for SMCR). For now, you will just have
to set sd2i to something (e.g., 0).
Thanks for bringing this
I was not sure who I should contact about this, so I am posting this here.
There are a few broken links on the R website.
1) http://www.r-project.org/search.html - link to the Nabble R Forum. I belive
the correct/new URL should be: http://r.789695.n4.nabble.com/
2)
Dear Chunyan,
One possibility would be to use the harmonic mean of the person-time at risk
values. You will have to do this manually though at the moment. Here is an
example:
### let's just use the treatment group data from dat.warfarin
data(dat.warfarin)
dat - escalc(xi=x1i, ti=t1i,
Dear Romita,
It is not quite clear to me what exactly you want the graph to look like. What
do you mean by plots of the unadjusted and adjusted models?
In general though, it sounds to me as if the graph you have in mind is rather
complex. It may be possible to accomplish this with the forest()
Please see my answers below.
Best,
Wolfgang
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Moon Qiang
Sent: Thursday, May 16, 2013 19:12
To: r-help
Subject: [R] using metafor for meta-analysis of before-after studies
Dear Branwen,
This means that your design matrix is not of full rank (in a more recent
version of the metafor package, the error message is a bit more informative;
i.e., please upgrade). Since continent is a factor, this should imply that
one of the levels never actually occurs, leading to a
...@gmail.com]
Sent: Wednesday, May 22, 2013 20:38
To: Viechtbauer Wolfgang (STAT); r-help
Subject: Re: RE: [R] using metafor for meta-analysis of before-after
studies (escalc, SMCC)
Dear Dr. Viechtbauer:
Thank you very much for sparing your precious time to answer my question.
I still want
I have come across this issue many times. I have yet to find a pattern in what
causes this.
At least I can offer a workaround. Instead of using Save As to create the
pdf, what I do is Print with Adobe PDF as the printer. This gets rid of
those lines and the resulting pdf looks just as nice.
Dear Marc,
Let me see if I understand the type of data you have. You say that you have 5
experiments. And within each experiment, you have n subjects and for each
subject, you have data in the form described in your post. Now for each
subject, you want to calculate some kind of measure that
Wolfgang (STAT); r-help@r-project.org
Subject: Re: [R] Meta-analysis on a repeated measures design with multiple
trials per subject using metafor
Dear Michael and other readers,
Please see below for my answers to your questions about my data.
On 07/06/2013 02:56 PM, Michael Dewey wrote
I think Michael already gave you some really good hints. To add a bit more
details to this, first of all, I suggest to use:
q2 - rma(yi, vi, mods=cbind(grupo), data=qim)
forest(q2, transf=transf.ztor, digits=3, alim=c(0,1), refline=.5, addfit=FALSE)
so that the fitted values for that
Just replace the fixed y coordinate values in the text() calls with something
that will change appropriately with the number of studies/effects included in
the plot. For example:
text(c(-9.5,-8,-6,-4.5), res$k+2, c(TB+, TB-, TB+, TB-))
text(c(-8.75,-5.25), res$k+3, c(Vaccinated, Control))
1 - 100 of 167 matches
Mail list logo