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
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
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
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
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
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
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
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)
What you are describing is a path model (e.g., http://bit.ly/f4siTs). You can
fit such a model with the sem package
(http://cran.r-project.org/web/packages/sem/index.html).
Best,
--
Wolfgang Viechtbauer
Department of Psychiatry and Neuropsychology
School for Mental Health and Neuroscience
Dear Mario,
If you could tell me how to define and interpret I^2 and H^2 for models with
moderators, I may consider implementing these measures for such models.
However, I am not aware of any work that has extended these measures to
meta-regression models.
Best,
--
Wolfgang Viechtbauer
Dear Mario,
See: http://www.mail-archive.com/r-help@r-project.org/msg117622.html
This seems to be fixed in version 2.12.1 (at least, I do not get this problem
anymore).
Best,
Wolfgang
From: r-help-boun...@r-project.org [r-help-boun...@r-project.org]
That's definitely one for the fortune package!
Wolfgang
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Frank Harrell
Sent: Monday, February 14, 2011 14:50
To: r-help@r-project.org
Subject: Re: [R] Optimal Y=q cutoff after
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
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
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 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
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
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,
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
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
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 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
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
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
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
:
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
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 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
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
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
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
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
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)
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 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) {
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
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
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
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 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)
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,
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
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
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 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 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
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
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
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:
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/
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
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 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
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,
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:
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
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
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
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
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
101 - 167 of 167 matches
Mail list logo