Re: [R] metafor all list elements must be square matrices

2018-10-25 Thread Michael Dewey

Dear Hugh

1 - Your post is unreadable because you posted in HTML so it will be 
very difficult for anyone to see your V


2 - there is a separate mailing list for meta-analysis in R where you 
may get more helpful responses as it is monitored by authors of most of 
the main packages. Please see 
https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis// and remember 
to register first.


Michael


On 24/10/2018 22:35, Crean, Hugh wrote:

This may be a very simple fix, but I am struggling to reproduce Becker's (1988) 
imputation of control group effect sizes for single group trials.  For some reason that I 
cannot figure out, I am getting an "All list elements in 'V' must be square 
matrices".  Below is my V matrix, which I believe is square:

Study1

Study2

Study3

Study4

Study5

Study6

Study7

Study8

0.118

0

0

0

0

0.010465

0.010465

0.010465

0

0.121

0

0

0

0.010465

0.010465

0.010465

0

0

0.404

0

0

0.010465

0.010465

0.010465

0

0

0

0.146

0

0.010465

0.010465

0.010465

0

0

0

0

0.09

0.010465

0.010465

0.010465

0.010465

0.010465

0.010465

0.010465

0.010465

0.104465

0.010465

0.010465

0.010465

0.010465

0.010465

0.010465

0.010465

0.010465

0.085465

0.010465

0.010465

0.010465

0.010465

0.010465

0.010465

0.010465

0.010465

0.069465


I get the error running as a multivariate rma.  If I run as a simple rma, I get 
a non-positive sampling variances error message (but the correlations are all 
at least between 0 and 1).

Any help is greatly appreciated.

Hugh

Hugh F. Crean, Ph.D.
Assistant Professor of Clinical Nursing
2W.156 Helen Wood Hall
School of Nursing
University of Rochester
601 Elmwood Avenue
Rochester, New York  14620

(585) 276-5575



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.



--
Michael
http://www.dewey.myzen.co.uk/home.html

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] metafor all list elements must be square matrices

2018-10-25 Thread Crean, Hugh
This may be a very simple fix, but I am struggling to reproduce Becker's (1988) 
imputation of control group effect sizes for single group trials.  For some 
reason that I cannot figure out, I am getting an "All list elements in 'V' must 
be square matrices".  Below is my V matrix, which I believe is square:

Study1

Study2

Study3

Study4

Study5

Study6

Study7

Study8

0.118

0

0

0

0

0.010465

0.010465

0.010465

0

0.121

0

0

0

0.010465

0.010465

0.010465

0

0

0.404

0

0

0.010465

0.010465

0.010465

0

0

0

0.146

0

0.010465

0.010465

0.010465

0

0

0

0

0.09

0.010465

0.010465

0.010465

0.010465

0.010465

0.010465

0.010465

0.010465

0.104465

0.010465

0.010465

0.010465

0.010465

0.010465

0.010465

0.010465

0.010465

0.085465

0.010465

0.010465

0.010465

0.010465

0.010465

0.010465

0.010465

0.010465

0.069465


I get the error running as a multivariate rma.  If I run as a simple rma, I get 
a non-positive sampling variances error message (but the correlations are all 
at least between 0 and 1).

Any help is greatly appreciated.

Hugh

Hugh F. Crean, Ph.D.
Assistant Professor of Clinical Nursing
2W.156 Helen Wood Hall
School of Nursing
University of Rochester
601 Elmwood Avenue
Rochester, New York  14620

(585) 276-5575



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Metafor multilevel metaregression: total variance increases when moderator added?

2017-03-01 Thread Michael Dewey

Dear Laura

If you are unable for some reason to share the data why not incorporate 
the output into an e-mail (and please turn of HTML as it mangles 
everything). Putting the plots from profiling somewhere we can read them 
would be a useful addition.


This looks at first glance one of those situations where sadly one has 
insufficient data for the models one would like to fit. We feel your pain.


On 28/02/2017 12:54, Viechtbauer Wolfgang (SP) wrote:

Very difficult to diagnose what is going on without actually seeing the data. 
But as I said on CV: Depending on the data, the variance components may not be 
estimated precisely, so negative values for those kinds of pseudo-R^2 
statistics are quite possible. In fact, if a particular moderator is actually 
unrelated to the outcomes, then in roughly 50% of the cases, the pseudo-R^2 
statistic will be negative.

See also:

Lopez-Lopez, J. A., Marin-Martinez, F., Sanchez-Meca, J., Van den Noortgate, W., 
& Viechtbauer, W. (2014). Estimation of the predictive power of the model in 
mixed-effects meta-regression: A simulation study. British Journal of Mathematical 
and Statistical Psychology, 67(1), 30-48.

We only examined the standard mixed-effects meta-regression model with a single 
moderator, but found that the pseudo-R^2 statistic can be all over the place 
unless k is quite large.

Now you seem to have a larger number of estimates (170), but these are nested 
in 'only' 26 studies. So, I suspect that the estimate-level variance component 
is estimated fairly precisely, but not the study-level variance component. You 
may want to examine the profile plots (with the profile() function) and/or get 
(profile-likelihood) CIs of the variance components (using the confint() 
function). Probably the CI for the study-level variance component is quite wide.

Best,
Wolfgang



--
Michael
http://www.dewey.myzen.co.uk/home.html

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Metafor multilevel metaregression: total variance increases when moderator added?

2017-02-28 Thread Viechtbauer Wolfgang (SP)
Very difficult to diagnose what is going on without actually seeing the data. 
But as I said on CV: Depending on the data, the variance components may not be 
estimated precisely, so negative values for those kinds of pseudo-R^2 
statistics are quite possible. In fact, if a particular moderator is actually 
unrelated to the outcomes, then in roughly 50% of the cases, the pseudo-R^2 
statistic will be negative.

See also:

Lopez-Lopez, J. A., Marin-Martinez, F., Sanchez-Meca, J., Van den Noortgate, 
W., & Viechtbauer, W. (2014). Estimation of the predictive power of the model 
in mixed-effects meta-regression: A simulation study. British Journal of 
Mathematical and Statistical Psychology, 67(1), 30-48.

We only examined the standard mixed-effects meta-regression model with a single 
moderator, but found that the pseudo-R^2 statistic can be all over the place 
unless k is quite large.

Now you seem to have a larger number of estimates (170), but these are nested 
in 'only' 26 studies. So, I suspect that the estimate-level variance component 
is estimated fairly precisely, but not the study-level variance component. You 
may want to examine the profile plots (with the profile() function) and/or get 
(profile-likelihood) CIs of the variance components (using the confint() 
function). Probably the CI for the study-level variance component is quite wide.

Best,
Wolfgang

-- 
Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com

>-Original Message-
>From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Duncan,
>Laura
>Sent: Monday, February 27, 2017 20:05
>To: r-help@r-project.org
>Subject: [R] Metafor multilevel metaregression: total variance increases
>when moderator added?
>
>Hi there,
>
>I am running a two level multilevel meta-regression of 170 estimates
>nested within 3 informants nested within 26 studies. I run the null model
>to get a pooled estimate with random effects at the informant level and
>study level.
>
>Then I test a series of potential moderators (one at a time, given small
>number of studies and adjust p-values for multiple testing). I use:
>(sum(Model1$sigma2) - sum(Model2$sigma2)) / sum(Model1$sigma2)
>to compute the proportional reduction in the total variance from here:
>http://stackoverflow.com/questions/22356450/getting-r-squared-from-a-
>mixed-effects-multilevel-model-in-metafor
>
>For one moderator, I get a negative value for reduced total variance and
>an unexpected negative coefficient. Based on Wolfgang's response in the
>link above this is possible "depending on the size of your dataset, those
>variance components may not be estimated very precisely and that can lead
>to such counter-intuitive results".
>
>I am trying to diagnose why this model is not being estimated properly and
>why I am getting an unexpected negative result. When I remove the second
>level from the model and run a single-level random effects models of 170
>estimates nested within 26 studies, the coefficient is positive and as we
>would expect.
>
>Does anyone have any suggestions for what might be going on or how I might
>diagnose the problem with this model?
>
>Thanks,
>Laura
>
>Laura Duncan, M.A.
>Research Coordinator
>Offord Centre for Child Studies
>McMaster University
>
>Tel: 905 525 9140 x21504
>Fax: 905 574 6665
>dunca...@mcmaster.ca
>ontariochildhealthstudy.ca
>offordcentre.com
>
>Mailing Address   Courier
>Address
>1280 Main St. W. MIP 201A   175 Longwood Rd. S.
>MIP 201A
>Hamilton, Ontario L8S 4K1 Hamilton, Ontario
>L8P 0A1

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] Metafor multilevel metaregression: total variance increases when moderator added?

2017-02-27 Thread Duncan, Laura
Hi there,

I am running a two level multilevel meta-regression of 170 estimates nested 
within 3 informants nested within 26 studies. I run the null model to get a 
pooled estimate with random effects at the informant level and study level.

Then I test a series of potential moderators (one at a time, given small number 
of studies and adjust p-values for multiple testing). I use:
(sum(Model1$sigma2) - sum(Model2$sigma2)) / sum(Model1$sigma2)
to compute the proportional reduction in the total variance from here:
http://stackoverflow.com/questions/22356450/getting-r-squared-from-a-mixed-effects-multilevel-model-in-metafor

For one moderator, I get a negative value for reduced total variance and an 
unexpected negative coefficient. Based on Wolfgang's response in the link above 
this is possible "depending on the size of your dataset, those variance 
components may not be estimated very precisely and that can lead to such 
counter-intuitive results".

I am trying to diagnose why this model is not being estimated properly and why 
I am getting an unexpected negative result. When I remove the second level from 
the model and run a single-level random effects models of 170 estimates nested 
within 26 studies, the coefficient is positive and as we would expect.

Does anyone have any suggestions for what might be going on or how I might 
diagnose the problem with this model?

Thanks,
Laura

Laura Duncan, M.A.
Research Coordinator
Offord Centre for Child Studies
McMaster University

Tel: 905 525 9140 x21504
Fax: 905 574 6665
dunca...@mcmaster.ca
ontariochildhealthstudy.ca
offordcentre.com

Mailing Address   Courier Address
1280 Main St. W. MIP 201A   175 Longwood Rd. S. MIP 201A
Hamilton, Ontario L8S 4K1 Hamilton, Ontario L8P 0A1


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] metafor rma.mv weights questions

2017-02-02 Thread Viechtbauer Wolfgang (SP)
Hi Laura,

As far as I am concerned, you account for multiple effects sizes from the same 
study by setting up and fitting an appropriate model, not by fiddling with the 
weights. Several examples are described here:

http://www.metafor-project.org/doku.php/analyses#multivariate_multilevel_meta-analysis_models

The model implies the structure of the variance-covariance matrix of the 
estimates. The inverse of this var-cov matrix then implies the weights (and for 
multilevel/multivariate data, this is no longer a diagonal matrix, so there are 
not just weights, but an entire weight matrix). See also help(rma.mv) in 
metafor.

So, if you fit an appropriate model to the data at hand, the 'default weights' 
used by rma.mv() will be just fine.

Best,
Wolfgang

-- 
Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com

>-Original Message-
>From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Duncan,
>Laura
>Sent: Monday, January 30, 2017 18:18
>To: r-help@r-project.org
>Subject: [R] metafor rma.mv weights questions
>
>Hi there,
>
>Question:
>Does the rma.mv command in metafor automically adjust the weights to
>account for multiple effect sizes within study or do these weights need to
>manually calculated and applied?
>
>Details:
>In setting up a multilevel meta-analysis and meta-regression with multiple
>effect sizes within studies, I have seen the suggestion to adjust the
>weights according to Hedges, Tipton, & Johnson (suggestion made at
>24.33mins in this tutorial https://www.youtube.com/watch?v=rJjeRRf23L8)
>using:
> Wij=1/Kj*mean V.j
>I am wondering if the data is structured hierarchically and the random
>effects for each level specified correctly, does the rma.mv command
>automatically adjust the weights in this way? Another way to ask this
>question is - what are the default weights used by rma.mv when there are
>multiple estimates within studies?
>
>Thanks
>Laura
>
>Laura Duncan, M.A.
>Research Coordinator
>Offord Centre for Child Studies
>McMaster University
>
>Tel: 905 525 9140 x21504
>Fax: 905 574 6665
>dunca...@mcmaster.ca
>ontariochildhealthstudy.ca
>offordcentre.com
>
>Mailing Address   Courier
>Address
>1280 Main St. W. MIP 201A   175 Longwood Rd. S.
>MIP 201A
>Hamilton, Ontario L8S 4K1     Hamilton, Ontario
>L8P 0A1

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] metafor rma.mv weights questions

2017-01-30 Thread Duncan, Laura
Hi there, 

Question:
Does the rma.mv command in metafor automically adjust the weights to account 
for multiple effect sizes within study or do these weights need to manually 
calculated and applied?

Details:
In setting up a multilevel meta-analysis and meta-regression with multiple 
effect sizes within studies, I have seen the suggestion to adjust the weights 
according to Hedges, Tipton, & Johnson (suggestion made at 24.33mins in this 
tutorial https://www.youtube.com/watch?v=rJjeRRf23L8) using:
 Wij=1/Kj*mean V.j
I am wondering if the data is structured hierarchically and the random effects 
for each level specified correctly, does the rma.mv command automatically 
adjust the weights in this way? Another way to ask this question is - what are 
the default weights used by rma.mv when there are multiple estimates within 
studies? 

Thanks
Laura

Laura Duncan, M.A.
Research Coordinator
Offord Centre for Child Studies 
McMaster University

Tel: 905 525 9140 x21504
Fax: 905 574 6665
dunca...@mcmaster.ca
ontariochildhealthstudy.ca
offordcentre.com

Mailing Address   Courier Address
1280 Main St. W. MIP 201A   175 Longwood Rd. S. MIP 201A
Hamilton, Ontario L8S 4K1     Hamilton, Ontario L8P 0A1

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] metafor estimates using mods and subset do not match

2016-07-29 Thread Michael Dewey

Dear Kathryn

I think that the author of metafor has addressed this

http://www.metafor-project.org/doku.php/tips:comp_two_independent_estimates

The other tips on that site are well worth reading too.

On 29/07/2016 14:44, Morris, Kathryn wrote:

I am running a meta-analysis using metafor and getting what seem to be 
conflicting results.

#analysis with species moderator
cropMeta.species<-rma(cropyi, cropvi, data=dataCropMeta, mods=~dataCropMeta$species - 1, 
method="HE")

The output for the analysis using species as a moderator shows estimates for 
the seven species in my data set, and makes sense.

#subset analysis with B oleraceae
cropMeta.species.b.oleracea<-rma(cropyi, cropvi, data=dataCropMeta, subset=(species=="B. 
oleracea"), method="HE")

Then when I start to plot the results and use separate analyses for each 
species in order to get the coef and variances for plotting the subgroups I get 
different estimates. The estimates for most subgroups are almost identical in 
both analyses, but one of them is 5.922 in the analysis with species as a 
moderator, and 7.0139 in the subset analysis for only that species.

Why are the estimates different? If they should be different, then which 
analysis is producing the correct estimates?

I'm happy to provide the data and R scripts if that would help.

many thanks,
Kathryn


-

 Dr. Kathryn Morris
 Assistant Professor, Biology
 Xavier University
 3800 Victory Parkway
 Cincinnati, OH
 45207

 Office: (513) 745-3554

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.



--
Michael
http://www.dewey.myzen.co.uk/home.html

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] metafor estimates using mods and subset do not match

2016-07-29 Thread Bert Gunter
I think you should consult with a local statistician. Generally
speaking, statistical questions like this tend to be OT here, and you
appear to be sufficiently confused about the statistical issues that
online posts would not be sufficient.

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Fri, Jul 29, 2016 at 6:44 AM, Morris, Kathryn  wrote:
> I am running a meta-analysis using metafor and getting what seem to be 
> conflicting results.
>
> #analysis with species moderator
> cropMeta.species<-rma(cropyi, cropvi, data=dataCropMeta, 
> mods=~dataCropMeta$species - 1, method="HE")
>
> The output for the analysis using species as a moderator shows estimates for 
> the seven species in my data set, and makes sense.
>
> #subset analysis with B oleraceae
> cropMeta.species.b.oleracea<-rma(cropyi, cropvi, data=dataCropMeta, 
> subset=(species=="B. oleracea"), method="HE")
>
> Then when I start to plot the results and use separate analyses for each 
> species in order to get the coef and variances for plotting the subgroups I 
> get different estimates. The estimates for most subgroups are almost 
> identical in both analyses, but one of them is 5.922 in the analysis with 
> species as a moderator, and 7.0139 in the subset analysis for only that 
> species.
>
> Why are the estimates different? If they should be different, then which 
> analysis is producing the correct estimates?
>
> I'm happy to provide the data and R scripts if that would help.
>
> many thanks,
> Kathryn
>
>
> -
>
>  Dr. Kathryn Morris
>  Assistant Professor, Biology
>  Xavier University
>  3800 Victory Parkway
>  Cincinnati, OH
>  45207
>
>  Office: (513) 745-3554
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] metafor estimates using mods and subset do not match

2016-07-29 Thread Morris, Kathryn
I am running a meta-analysis using metafor and getting what seem to be 
conflicting results.

#analysis with species moderator 
cropMeta.species<-rma(cropyi, cropvi, data=dataCropMeta, 
mods=~dataCropMeta$species - 1, method="HE")

The output for the analysis using species as a moderator shows estimates for 
the seven species in my data set, and makes sense.

#subset analysis with B oleraceae
cropMeta.species.b.oleracea<-rma(cropyi, cropvi, data=dataCropMeta, 
subset=(species=="B. oleracea"), method="HE")

Then when I start to plot the results and use separate analyses for each 
species in order to get the coef and variances for plotting the subgroups I get 
different estimates. The estimates for most subgroups are almost identical in 
both analyses, but one of them is 5.922 in the analysis with species as a 
moderator, and 7.0139 in the subset analysis for only that species.

Why are the estimates different? If they should be different, then which 
analysis is producing the correct estimates?

I'm happy to provide the data and R scripts if that would help.

many thanks,
Kathryn  
 
 
-

 Dr. Kathryn Morris
 Assistant Professor, Biology
 Xavier University
 3800 Victory Parkway
 Cincinnati, OH
 45207

 Office: (513) 745-3554
  
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] metafor package

2015-12-12 Thread John Peterson
Hi Dr. Viechtbauer,

Thank you very much. Putting in sei=se in forest()  fixed the problem.
Thanks for your help.

On 8 December 2015 at 08:37, Viechtbauer Wolfgang (STAT) <
wolfgang.viechtba...@maastrichtuniversity.nl> wrote:

> The first and second argument of forest() (or more precisely,
> forest.default()) are for the estimates and the corresponding sampling
> variances, respectively. So, if you do forest(rr, se, ...), then the
> function will interpret the standard errors as if they are variances. So,
> you should do forest(rr, sei=se, ...).
>
> And just in case: In all likelihood, those SEs are for the
> *log-transformed* risk ratios, so you should also pass log-transformed risk
> ratios to the function (and then use 'atransf=exp' so results are shown
> with back-transformed x-axis labels and annotations).
>
> Best,
> Wolfgang
>
> --
> Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
> Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
> Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com
>
> > -Original Message-
> > From: John Peterson [mailto:john.peterson@gmail.com]
> > Sent: Tuesday, December 08, 2015 14:25
> > To: Viechtbauer Wolfgang (STAT)
> > Cc: R-help@r-project.org
> > Subject: Re: [R] metafor package
> >
> > Hi Dr. Viechtbauer,
> >
> > The code provided in the metafor projects website for subgroup includes
> > fitting a random effects model on the entire dataset and fitting a random
> > effects model within subgroups. When I exactly follow this code, my
> > estimates and confidence intervals for estimate within each subgroup
> > matches with what I get in STATA so it seems to be the correct estimate
> > (and CI). However, I don't want to present an overall effect and I want
> > to present only the effect within each subgroup. In my second attempt, I
> > did not run a random effects model within the entire dataset and only ran
> > the models within each subgroup. I generated a variable corresponding to
> > the estimate(risk ratio) and standard error  which I plugged in the
> > forest() function (i.e. forest(rr, se, .).  When I run this code, the
> > estimate I get for each subgroup is slightly different than the estimate
> > I get for each subgroup in comparison to when I also included the random
> > effects model for the overall effect. (i.e. my first attempt). Is this
> > the right approach? I was not clear when you said passing the estimates
> > and sampling variances to the forest() function. I created a variable
> > corresponding to the estimate and standard error and plugged those in the
> > forest() function. I am not sure if this is the right approach. Thanks,
> >
> > John
> >
> > On 8 December 2015 at 03:47, Viechtbauer Wolfgang (STAT)
> > <wolfgang.viechtba...@maastrichtuniversity.nl> wrote:
> > Hi John,
> >
> > Please keep r-help copied on the reply.
> >
> > What's the 'previous model'? How do you get estimates within subgroups
> > that 'includes the overall effect'? I really cannot follow you here.
> >
> > Best,
> > Wolfgang
> >
> > --
> > Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
> > Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
> > Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com
> >
> > > -Original Message-
> > > From: John Peterson [mailto:john.peterson@gmail.com]
> > > Sent: Monday, December 07, 2015 22:14
> > > To: Viechtbauer Wolfgang (STAT)
> > > Subject: Re: [R] metafor package
> > >
> > > Hi Dr. Viechtbauer,
> > > Thank you very much for your reply. I tried your advice and was able to
> > > make a forest plot with only the estimates for each subgroup.For the
> > > estiamte for each subgroup, similar to the previous model, I random
> > > effects model within each subgroup. However, I now find the result for
> > > the estiamte within subgroup to be different thant the result for the
> > > previous model. I have tried analyzing this in STATA and I get the same
> > > result as the model which includes the overall effect. Any advice on
> > what
> > > may be wrong here? Thanks greatly,
> > > John
> > >
> > > On 7 December 2015 at 04:02, Viechtbauer Wolfgang (STAT)
> > > <wolfgang.viechtba...@maastrichtuniversity.nl> wrote:
> > > The code you posted is totally mangled up, but it's just what can be
> > > found here:
> > >
> > > http

Re: [R] metafor package

2015-12-08 Thread Viechtbauer Wolfgang (STAT)
Hi John,

Please keep r-help copied on the reply.

What's the 'previous model'? How do you get estimates within subgroups that 
'includes the overall effect'? I really cannot follow you here.

Best,
Wolfgang

-- 
Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com

> -Original Message-
> From: John Peterson [mailto:john.peterson@gmail.com]
> Sent: Monday, December 07, 2015 22:14
> To: Viechtbauer Wolfgang (STAT)
> Subject: Re: [R] metafor package
> 
> Hi Dr. Viechtbauer,
> Thank you very much for your reply. I tried your advice and was able to
> make a forest plot with only the estimates for each subgroup.For the
> estiamte for each subgroup, similar to the previous model, I random
> effects model within each subgroup. However, I now find the result for
> the estiamte within subgroup to be different thant the result for the
> previous model. I have tried analyzing this in STATA and I get the same
> result as the model which includes the overall effect. Any advice on what
> may be wrong here? Thanks greatly,
> John
> 
> On 7 December 2015 at 04:02, Viechtbauer Wolfgang (STAT)
> <wolfgang.viechtba...@maastrichtuniversity.nl> wrote:
> The code you posted is totally mangled up, but it's just what can be
> found here:
> 
> http://www.metafor-project.org/doku.php/plots:forest_plot_with_subgroups
> 
> If you don't want an overall estimate, just pass the estimates and
> corresponding sampling variances to the forest() function (and not the
> model object). Use the 'rows' argument to specify where the estimates
> will be placed and adjust 'ylim' so give you enough space to leave gaps
> for headings and the subgroup estimates. Then fit models within the
> subgroups (the 'subset' argument is useful here) and use addpoly() to add
> the subgroup estimates in the appropriate rows. With text(), you can add
> headings as needed.
> 
> If you use weights() on each subgroup model object, you can get the
> subgroup weights (that add up to 100% within each subgroup). It's
> probably easiest to just add those values with text() in an appropriate
> place to the plot.
> 
> Best,
> Wolfgang
> 
> --
> Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
> Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
> Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com
> 
> > -Original Message-
> > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of John
> > Peterson
> > Sent: Monday, December 07, 2015 01:39
> > To: r-help@r-project.org
> > Subject: [R] metafor package
> >
> > Hi Everyone,
> >
> > I am conducting a meta-analysis using the metafor package. I am
> > interested
> > in obtaining an estimate by subgroup only without showing an overall
> > effect. This is directly from the metafor website. How would i modify
> > this
> > code to only show subgroup effects? Further, I want to show weights by
> > subgroup. The option showweights=TRUE does not display weights by
> > subgroup
> > but by the weight of each study in comparison to all studies (and not
> the
> > subgroup). You help would be appreciated.

[snip garbled code]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] metafor package

2015-12-08 Thread John Peterson
Hi Dr. Viechtbauer,

The code provided in the metafor projects website for subgroup includes
fitting a random effects model on the entire dataset and fitting a random
effects model within subgroups. When I exactly follow this code, my
estimates and confidence intervals for estimate within each subgroup
matches with what I get in STATA so it seems to be the correct estimate
(and CI). However, I don't want to present an overall effect and I want to
present only the effect within each subgroup. In my second attempt, I did
not run a random effects model within the entire dataset and only ran the
models within each subgroup. I generated a variable corresponding to the
estimate(risk ratio) and standard error  which I plugged in the forest()
function (i.e. forest(rr, se, .).  When I run this code, the estimate I
get for each subgroup is slightly different than the estimate I get for
each subgroup in comparison to when I also included the random effects
model for the overall effect. (i.e. my first attempt). Is this the right
approach? I was not clear when you said passing the estimates and sampling
variances to the forest() function. I created a variable corresponding to
the estimate and standard error and plugged those in the forest() function.
I am not sure if this is the right approach. Thanks,

John

On 8 December 2015 at 03:47, Viechtbauer Wolfgang (STAT) <
wolfgang.viechtba...@maastrichtuniversity.nl> wrote:

> Hi John,
>
> Please keep r-help copied on the reply.
>
> What's the 'previous model'? How do you get estimates within subgroups
> that 'includes the overall effect'? I really cannot follow you here.
>
> Best,
> Wolfgang
>
> --
> Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
> Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
> Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com
>
> > -Original Message-
> > From: John Peterson [mailto:john.peterson@gmail.com]
> > Sent: Monday, December 07, 2015 22:14
> > To: Viechtbauer Wolfgang (STAT)
> > Subject: Re: [R] metafor package
> >
> > Hi Dr. Viechtbauer,
> > Thank you very much for your reply. I tried your advice and was able to
> > make a forest plot with only the estimates for each subgroup.For the
> > estiamte for each subgroup, similar to the previous model, I random
> > effects model within each subgroup. However, I now find the result for
> > the estiamte within subgroup to be different thant the result for the
> > previous model. I have tried analyzing this in STATA and I get the same
> > result as the model which includes the overall effect. Any advice on what
> > may be wrong here? Thanks greatly,
> > John
> >
> > On 7 December 2015 at 04:02, Viechtbauer Wolfgang (STAT)
> > <wolfgang.viechtba...@maastrichtuniversity.nl> wrote:
> > The code you posted is totally mangled up, but it's just what can be
> > found here:
> >
> > http://www.metafor-project.org/doku.php/plots:forest_plot_with_subgroups
> >
> > If you don't want an overall estimate, just pass the estimates and
> > corresponding sampling variances to the forest() function (and not the
> > model object). Use the 'rows' argument to specify where the estimates
> > will be placed and adjust 'ylim' so give you enough space to leave gaps
> > for headings and the subgroup estimates. Then fit models within the
> > subgroups (the 'subset' argument is useful here) and use addpoly() to add
> > the subgroup estimates in the appropriate rows. With text(), you can add
> > headings as needed.
> >
> > If you use weights() on each subgroup model object, you can get the
> > subgroup weights (that add up to 100% within each subgroup). It's
> > probably easiest to just add those values with text() in an appropriate
> > place to the plot.
> >
> > Best,
> > Wolfgang
> >
> > --
> > Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
> > Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
> > Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com
> >
> > > -Original Message-
> > > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of John
> > > Peterson
> > > Sent: Monday, December 07, 2015 01:39
> > > To: r-help@r-project.org
> > > Subject: [R] metafor package
> > >
> > > Hi Everyone,
> > >
> > > I am conducting a meta-analysis using the metafor package. I am
> > > interested
> > > in obtaining an estimate by subgroup only without showing an overall
> > > effect. This is directly from the metafor website. How 

Re: [R] metafor package

2015-12-08 Thread Viechtbauer Wolfgang (STAT)
The first and second argument of forest() (or more precisely, forest.default()) 
are for the estimates and the corresponding sampling variances, respectively. 
So, if you do forest(rr, se, ...), then the function will interpret the 
standard errors as if they are variances. So, you should do forest(rr, sei=se, 
...).

And just in case: In all likelihood, those SEs are for the *log-transformed* 
risk ratios, so you should also pass log-transformed risk ratios to the 
function (and then use 'atransf=exp' so results are shown with back-transformed 
x-axis labels and annotations).

Best,
Wolfgang

-- 
Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com

> -Original Message-
> From: John Peterson [mailto:john.peterson@gmail.com]
> Sent: Tuesday, December 08, 2015 14:25
> To: Viechtbauer Wolfgang (STAT)
> Cc: R-help@r-project.org
> Subject: Re: [R] metafor package
> 
> Hi Dr. Viechtbauer,
> 
> The code provided in the metafor projects website for subgroup includes
> fitting a random effects model on the entire dataset and fitting a random
> effects model within subgroups. When I exactly follow this code, my
> estimates and confidence intervals for estimate within each subgroup
> matches with what I get in STATA so it seems to be the correct estimate
> (and CI). However, I don't want to present an overall effect and I want
> to present only the effect within each subgroup. In my second attempt, I
> did not run a random effects model within the entire dataset and only ran
> the models within each subgroup. I generated a variable corresponding to
> the estimate(risk ratio) and standard error  which I plugged in the
> forest() function (i.e. forest(rr, se, .).  When I run this code, the
> estimate I get for each subgroup is slightly different than the estimate
> I get for each subgroup in comparison to when I also included the random
> effects model for the overall effect. (i.e. my first attempt). Is this
> the right approach? I was not clear when you said passing the estimates
> and sampling variances to the forest() function. I created a variable
> corresponding to the estimate and standard error and plugged those in the
> forest() function. I am not sure if this is the right approach. Thanks,
> 
> John
> 
> On 8 December 2015 at 03:47, Viechtbauer Wolfgang (STAT)
> <wolfgang.viechtba...@maastrichtuniversity.nl> wrote:
> Hi John,
> 
> Please keep r-help copied on the reply.
> 
> What's the 'previous model'? How do you get estimates within subgroups
> that 'includes the overall effect'? I really cannot follow you here.
> 
> Best,
> Wolfgang
> 
> --
> Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
> Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
> Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com
> 
> > -Original Message-
> > From: John Peterson [mailto:john.peterson@gmail.com]
> > Sent: Monday, December 07, 2015 22:14
> > To: Viechtbauer Wolfgang (STAT)
> > Subject: Re: [R] metafor package
> >
> > Hi Dr. Viechtbauer,
> > Thank you very much for your reply. I tried your advice and was able to
> > make a forest plot with only the estimates for each subgroup.For the
> > estiamte for each subgroup, similar to the previous model, I random
> > effects model within each subgroup. However, I now find the result for
> > the estiamte within subgroup to be different thant the result for the
> > previous model. I have tried analyzing this in STATA and I get the same
> > result as the model which includes the overall effect. Any advice on
> what
> > may be wrong here? Thanks greatly,
> > John
> >
> > On 7 December 2015 at 04:02, Viechtbauer Wolfgang (STAT)
> > <wolfgang.viechtba...@maastrichtuniversity.nl> wrote:
> > The code you posted is totally mangled up, but it's just what can be
> > found here:
> >
> > http://www.metafor-
> project.org/doku.php/plots:forest_plot_with_subgroups
> >
> > If you don't want an overall estimate, just pass the estimates and
> > corresponding sampling variances to the forest() function (and not the
> > model object). Use the 'rows' argument to specify where the estimates
> > will be placed and adjust 'ylim' so give you enough space to leave gaps
> > for headings and the subgroup estimates. Then fit models within the
> > subgroups (the 'subset' argument is useful here) and use addpoly() to
> add
> > the subgroup estimates in the appropriate rows. With text(), you can
> add
&

Re: [R] metafor package

2015-12-07 Thread Viechtbauer Wolfgang (STAT)
The code you posted is totally mangled up, but it's just what can be found here:

http://www.metafor-project.org/doku.php/plots:forest_plot_with_subgroups

If you don't want an overall estimate, just pass the estimates and 
corresponding sampling variances to the forest() function (and not the model 
object). Use the 'rows' argument to specify where the estimates will be placed 
and adjust 'ylim' so give you enough space to leave gaps for headings and the 
subgroup estimates. Then fit models within the subgroups (the 'subset' argument 
is useful here) and use addpoly() to add the subgroup estimates in the 
appropriate rows. With text(), you can add headings as needed.

If you use weights() on each subgroup model object, you can get the subgroup 
weights (that add up to 100% within each subgroup). It's probably easiest to 
just add those values with text() in an appropriate place to the plot.

Best,
Wolfgang

-- 
Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com

> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of John
> Peterson
> Sent: Monday, December 07, 2015 01:39
> To: r-help@r-project.org
> Subject: [R] metafor package
> 
> Hi Everyone,
> 
> I am conducting a meta-analysis using the metafor package. I am
> interested
> in obtaining an estimate by subgroup only without showing an overall
> effect. This is directly from the metafor website. How would i modify
> this
> code to only show subgroup effects? Further, I want to show weights by
> subgroup. The option showweights=TRUE does not display weights by
> subgroup
> but by the weight of each study in comparison to all studies (and not the
> subgroup). You help would be appreciated.
> 
> library <http://stat.ethz.ch/R-manual/R-
> devel/library/base/html/library.html>(metafor)
>  ### to save as png filepng
> <http://stat.ethz.ch/R-manual/R-
> devel/library/grDevices/html/png.html>(filename="forest_plot_with_subgrou
> ps.png",
> res=95, width=680, height=680, type="cairo")
>  ### decrease margins so the full space is usedpar
> <http://stat.ethz.ch/R-manual/R-
> devel/library/graphics/html/par.html>(mar=c
> <http://stat.ethz.ch/R-manual/R-devel/library/base/html/c.html>(4,4,1,2))
>  ### load BCG vaccine datadata
> <http://stat.ethz.ch/R-manual/R-
> devel/library/utils/html/data.html>(dat.bcg)
>  ### fit random-effects model (use slab argument to define study labels)
> res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, data
> <http://stat.ethz.ch/R-manual/R-
> devel/library/utils/html/data.html>=dat.bcg,
> measure="RR",
>slab=paste
> <http://stat.ethz.ch/R-manual/R-
> devel/library/base/html/paste.html>(author,
> year, sep=", "), method="REML")
>  ### set up forest plot (with 2x2 table counts added; rows argument is
> used### to specify exactly in which rows the outcomes will be plotted)
> forest(res, xlim=c
> <http://stat.ethz.ch/R-manual/R-devel/library/base/html/c.html>(-16,
> 6), at=log <http://stat.ethz.ch/R-manual/R-
> devel/library/base/html/log.html>(c
> <http://stat.ethz.ch/R-manual/R-devel/library/base/html/c.html>(.05,
> .25, 1, 4)), atransf=exp
> <http://stat.ethz.ch/R-manual/R-devel/library/base/html/exp.html>,
>ilab=cbind
> <http://stat.ethz.ch/R-manual/R-
> devel/library/base/html/cbind.html>(dat.bcg$tpos,
> dat.bcg$tneg, dat.bcg$cpos, dat.bcg$cneg),
>ilab.xpos=c
> <http://stat.ethz.ch/R-manual/R-devel/library/base/html/c.html>(-9.5,-8,-
> 6,-4.5),
> cex=.75, ylim=c
> <http://stat.ethz.ch/R-manual/R-devel/library/base/html/c.html>(-1,
> 27),
>order <http://stat.ethz.ch/R-manual/R-
> devel/library/base/html/order.html>=order
> <http://stat.ethz.ch/R-manual/R-
> devel/library/base/html/order.html>(dat.bcg$alloc),
> rows=c <http://stat.ethz.ch/R-manual/R-
> devel/library/base/html/c.html>(3:4,9:15,20:23),
>xlab="Relative Risk", mlab="RE Model for All Studies", psize=1)
>  ### set font expansion factor (as in forest() above) and use bold
> italic### font and save original settings in object 'op'
> op <- par <http://stat.ethz.ch/R-manual/R-
> devel/library/graphics/html/par.html>(cex=.75,
> font=4)
>  ### add text for the subgroupstext
> <http://stat.ethz.ch/R-manual/R-devel/library/graphics/html/text.html>(-
> 16,
> c <http://stat.ethz.ch/R-manual/R-
> devel/library/base/html/c.html>(24,16,5),
> pos=4, c <http://stat.ethz.ch/R-manual/R-
> devel/l

[R] metafor package

2015-12-06 Thread John Peterson
Hi Everyone,

I am conducting a meta-analysis using the metafor package. I am interested
in obtaining an estimate by subgroup only without showing an overall
effect. This is directly from the metafor website. How would i modify this
code to only show subgroup effects? Further, I want to show weights by
subgroup. The option showweights=TRUE does not display weights by subgroup
but by the weight of each study in comparison to all studies (and not the
subgroup). You help would be appreciated.

library 
(metafor)
 ### to save as png filepng
(filename="forest_plot_with_subgroups.png",
res=95, width=680, height=680, type="cairo")
 ### decrease margins so the full space is usedpar
(mar=c
(4,4,1,2))
 ### load BCG vaccine datadata
(dat.bcg)
 ### fit random-effects model (use slab argument to define study labels)
res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, data
=dat.bcg,
measure="RR",
   slab=paste
(author,
year, sep=", "), method="REML")
 ### set up forest plot (with 2x2 table counts added; rows argument is
used### to specify exactly in which rows the outcomes will be plotted)
forest(res, xlim=c
(-16,
6), at=log (c
(.05,
.25, 1, 4)), atransf=exp
,
   ilab=cbind
(dat.bcg$tpos,
dat.bcg$tneg, dat.bcg$cpos, dat.bcg$cneg),
   ilab.xpos=c
(-9.5,-8,-6,-4.5),
cex=.75, ylim=c
(-1,
27),
   order 
=order
(dat.bcg$alloc),
rows=c 
(3:4,9:15,20:23),
   xlab="Relative Risk", mlab="RE Model for All Studies", psize=1)
 ### set font expansion factor (as in forest() above) and use bold
italic### font and save original settings in object 'op'
op <- par 
(cex=.75,
font=4)
 ### add text for the subgroupstext
(-16,
c (24,16,5),
pos=4, c 
("Systematic
Allocation",
   "Random Allocation",
   "Alternate Allocation"))
 ### switch to bold fontpar
(font=2)
 ### add column headings to the plottext
(c
(-9.5,-8,-6,-4.5),
26, c ("TB+",
"TB-", "TB+", "TB-"))text
(c
(-8.75,-5.25),
27, c 
("Vaccinated",
"Control"))text
(-16,
   26, "Author(s) and Year", pos=4)text
(6,
 26, "Relative Risk [95% CI]", pos=2)
 ### set par back to the original settingspar
(op)
 ### fit random-effects model in the three subgroups
res.s <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, data
=dat.bcg,
measure="RR",
 subset
=(alloc=="systematic"),
method="REML")
res.r <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, data
=dat.bcg,
measure="RR",
 subset
=(alloc=="random"),
method="REML")
res.a <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, data
=dat.bcg,
measure="RR",
 subset

Re: [R] metafor - Meta-Analysis of rare events / beta-binomial regression

2015-11-30 Thread Markus Kösters
Dear Wolfgang,

Thanks a lot. I am sure that debate will continue. Kuss has apparently the 
advantage to be rather universal, which from an users perspective is always a 
big advantage. 

I'll check other options and think it over.

Many thanks,

Markus



-Ursprüngliche Nachricht-
Von: Viechtbauer Wolfgang (STAT) 
[mailto:wolfgang.viechtba...@maastrichtuniversity.nl] 
Gesendet: Freitag, 27. November 2015 16:01
An: Markus Kösters; 'Michael Dewey'; r-help@r-project.org
Betreff: RE: [R] metafor - Meta-Analysis of rare events / beta-binomial 
regression

I would say the issue of how to deal with 'double-zero' studies is far from 
settled. For example, under the (non-central) hypergeometric model, studies 
with no events have a flat likelihood, so they are automatically excluded. That 
may go against our intuition (for various reasons, some of them are aptly 
described on page 1098 in Kuss, 2015), but from a likelhood perspective, it is 
correct. And since the Mantel-Haenszel and Peto's method are also based on the 
hypergeometric model, they should also exclude double-zero studies. Now I am 
not so sure if we are ready to completely scrap these methods altogether simply 
because they exclude double-zero studies.

However, for 2x2 table data, I am all in favor of using methods that make more 
realistic distributional assumptions than the 'standard' approach that assumes 
that the sampling distribution of the log(odds ratio) is normal and has a known 
sampling variance. That's why metafor includes rma.glmm() for fitting 
appropriate unconditional mixed-effects logistic and the conditional 
mixed-effects logistic (i.e., hypergeometric) model to such data. And for 
fixed-effects models, there are also rma.mh() and rma.peto() for the 
Mantel-Haenszel and Peto's method.

I may also eventually include the beta-binomial model, but I need to give this 
some more thought. If you already want to start using this model, you will find 
implementions thereof in VGAM, aods3, and gamlss.

Best,
Wolfgang

-- 
Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com

> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Markus 
> Kösters
> Sent: Friday, November 27, 2015 14:38
> To: 'Michael Dewey'; r-help@r-project.org
> Subject: Re: [R] metafor - Meta-Analysis of rare events / 
> beta-binomial regression
> 
> Dear Michael,
> 
> Thank you very much for your input, that is very much appreciated. I 
> have not considered that method, because it's rather outlawed in 
> general. But it is also included in Kuss and if I understood 
> correctly, the collapsing method (and the Cochrane method) both 
> performed not too bad under FEM assumption and had weaknesses in REM. 
> I usually prefer a REM approach, but in this case that may not be that 
> important.
> I will also read the mmeta paper and documentation.
> 
> Thanks a lot!
> 
> Markus
> 
> -Ursprüngliche Nachricht-
> Von: Michael Dewey [mailto:li...@dewey.myzen.co.uk]
> Gesendet: Freitag, 27. November 2015 13:32
> An: Markus Kösters; r-help@r-project.org
> Betreff: Re: [R] metafor - Meta-Analysis of rare events / 
> beta-binomial regression
> 
> Dear Markus
> 
> This is not a direct answer to your question, I will leave that to 
> Wolfgang but two thoughts:
> 
> 1 - if all the studies have very sparse data @article{bradburn07,
> author = {Bradburn, M J and Deeks, J J and Berlin, J A and 
> Localio, A R},
> title = {Much ado about nothing: a comparison of the performance of
>meta--analytical methods with rare events},
> journal = {Statistics in Medicine},
> year = {2007},
> volume = {26},
> pages = {53--77},
> keywords = {meta-analysis, fixed effects, random effects} } 
> suggests, surprisingly, that just collapsing the tables may be 
> adequate
> 
> 2 - there is a CRAN package mmeta which uses beta-binomial in a 
> Bayesian perspective. I did not find the documentation very explicit 
> but there is a paper in JSS.
> 
> On 26/11/2015 13:39, Markus Kösters wrote:
> > Dear all,
> >
> > I am currently writing a protocol for a meta-analysis which will 
> > analyze suicidal events. Recently, O. Kuss has (DOI 
> > 10.1002/sim.6383) published a paper that suggest using beta-binomial 
> > regression methods to incorporate double-zero studies. He states 
> > that  Methods that ignore information from double-zero studies or 
> > use continuity corrections should no longer be used.  It seems 
> > obvious to me that excluding studies with zero events will bias the 
> > results and I am willing to follow his adv

Re: [R] metafor - Meta-Analysis of rare events / beta-binomial regression

2015-11-27 Thread Michael Dewey

Dear Markus

This is not a direct answer to your question, I will leave that to 
Wolfgang but two thoughts:


1 - if all the studies have very sparse data
@article{bradburn07,
   author = {Bradburn, M J and Deeks, J J and Berlin, J A and Localio, 
A R},

   title = {Much ado about nothing: a comparison of the performance of
  meta--analytical methods with rare events},
   journal = {Statistics in Medicine},
   year = {2007},
   volume = {26},
   pages = {53--77},
   keywords = {meta-analysis, fixed effects, random effects}
}
suggests, surprisingly, that just collapsing the tables may be adequate

2 - there is a CRAN package mmeta which uses beta-binomial in a Bayesian 
perspective. I did not find the documentation very explicit but there is 
a paper in JSS.


On 26/11/2015 13:39, Markus Kösters wrote:

Dear all,



I am currently writing a protocol for a meta-analysis which will analyze
suicidal events. Recently, O. Kuss has (DOI 10.1002/sim.6383) published a
paper that suggest using beta-binomial regression methods to incorporate
double-zero studies. He states that �Methods that ignore information from
double-zero studies or use continuity corrections should no longer be used.�
It seems obvious to me that excluding studies with zero events will bias the
results and I am willing to follow his advice. However, I am not a a
biometrician, I have to admit that I am at a loss if and how it is possible
to fit such model within the metafor package. Can someone help me or should
I use the Yusuf�Peto odds ratio method as suggested in the Cochrane
handbook?

Many thanks in advance,



Markus






[[alternative HTML version deleted]]



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.



--
Michael
http://www.dewey.myzen.co.uk/home.html

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] metafor - Meta-Analysis of rare events / beta-binomial regression

2015-11-27 Thread Markus Kösters
Dear Michael,

Thank you very much for your input, that is very much appreciated. I have not 
considered that method, because it's rather outlawed in general. But it is also 
included in Kuss and if I understood correctly, the collapsing method (and the 
Cochrane method) both performed not too bad under FEM assumption and had 
weaknesses in REM. I usually prefer a REM approach, but in this case that may 
not be that important.
I will also read the mmeta paper and documentation.

Thanks a lot!

Markus


-Ursprüngliche Nachricht-
Von: Michael Dewey [mailto:li...@dewey.myzen.co.uk] 
Gesendet: Freitag, 27. November 2015 13:32
An: Markus Kösters; r-help@r-project.org
Betreff: Re: [R] metafor - Meta-Analysis of rare events / beta-binomial 
regression

Dear Markus

This is not a direct answer to your question, I will leave that to Wolfgang but 
two thoughts:

1 - if all the studies have very sparse data @article{bradburn07,
author = {Bradburn, M J and Deeks, J J and Berlin, J A and Localio, A R},
title = {Much ado about nothing: a comparison of the performance of
   meta--analytical methods with rare events},
journal = {Statistics in Medicine},
year = {2007},
volume = {26},
pages = {53--77},
keywords = {meta-analysis, fixed effects, random effects} } suggests, 
surprisingly, that just collapsing the tables may be adequate

2 - there is a CRAN package mmeta which uses beta-binomial in a Bayesian 
perspective. I did not find the documentation very explicit but there is a 
paper in JSS.

On 26/11/2015 13:39, Markus Kösters wrote:
> Dear all,
>
>
>
> I am currently writing a protocol for a meta-analysis which will 
> analyze suicidal events. Recently, O. Kuss has (DOI 10.1002/sim.6383) 
> published a paper that suggest using beta-binomial regression methods 
> to incorporate double-zero studies. He states that  Methods that 
> ignore information from double-zero studies or use continuity 
> corrections should no longer be used.  It seems obvious to me that 
> excluding studies with zero events will bias the results and I am 
> willing to follow his advice. However, I am not a a biometrician, I 
> have to admit that I am at a loss if and how it is possible to fit 
> such model within the metafor package. Can someone help me or should I 
> use the Yusuf Peto odds ratio method as suggested in the Cochrane handbook?
>
> Many thanks in advance,
>
>
>
> Markus
>
>
>
>
>
>
>   [[alternative HTML version deleted]]
>
>
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 
> 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.
>

--
Michael
http://www.dewey.myzen.co.uk/home.html

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] metafor - Meta-Analysis of rare events / beta-binomial regression

2015-11-27 Thread Viechtbauer Wolfgang (STAT)
I would say the issue of how to deal with 'double-zero' studies is far from 
settled. For example, under the (non-central) hypergeometric model, studies 
with no events have a flat likelihood, so they are automatically excluded. That 
may go against our intuition (for various reasons, some of them are aptly 
described on page 1098 in Kuss, 2015), but from a likelhood perspective, it is 
correct. And since the Mantel-Haenszel and Peto's method are also based on the 
hypergeometric model, they should also exclude double-zero studies. Now I am 
not so sure if we are ready to completely scrap these methods altogether simply 
because they exclude double-zero studies.

However, for 2x2 table data, I am all in favor of using methods that make more 
realistic distributional assumptions than the 'standard' approach that assumes 
that the sampling distribution of the log(odds ratio) is normal and has a known 
sampling variance. That's why metafor includes rma.glmm() for fitting 
appropriate unconditional mixed-effects logistic and the conditional 
mixed-effects logistic (i.e., hypergeometric) model to such data. And for 
fixed-effects models, there are also rma.mh() and rma.peto() for the 
Mantel-Haenszel and Peto's method.

I may also eventually include the beta-binomial model, but I need to give this 
some more thought. If you already want to start using this model, you will find 
implementions thereof in VGAM, aods3, and gamlss.

Best,
Wolfgang

-- 
Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com

> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Markus
> Kösters
> Sent: Friday, November 27, 2015 14:38
> To: 'Michael Dewey'; r-help@r-project.org
> Subject: Re: [R] metafor - Meta-Analysis of rare events / beta-binomial
> regression
> 
> Dear Michael,
> 
> Thank you very much for your input, that is very much appreciated. I have
> not considered that method, because it's rather outlawed in general. But
> it is also included in Kuss and if I understood correctly, the collapsing
> method (and the Cochrane method) both performed not too bad under FEM
> assumption and had weaknesses in REM. I usually prefer a REM approach,
> but in this case that may not be that important.
> I will also read the mmeta paper and documentation.
> 
> Thanks a lot!
> 
> Markus
> 
> -Ursprüngliche Nachricht-
> Von: Michael Dewey [mailto:li...@dewey.myzen.co.uk]
> Gesendet: Freitag, 27. November 2015 13:32
> An: Markus Kösters; r-help@r-project.org
> Betreff: Re: [R] metafor - Meta-Analysis of rare events / beta-binomial
> regression
> 
> Dear Markus
> 
> This is not a direct answer to your question, I will leave that to
> Wolfgang but two thoughts:
> 
> 1 - if all the studies have very sparse data @article{bradburn07,
> author = {Bradburn, M J and Deeks, J J and Berlin, J A and Localio, A
> R},
> title = {Much ado about nothing: a comparison of the performance of
>meta--analytical methods with rare events},
> journal = {Statistics in Medicine},
> year = {2007},
> volume = {26},
> pages = {53--77},
> keywords = {meta-analysis, fixed effects, random effects} } suggests,
> surprisingly, that just collapsing the tables may be adequate
> 
> 2 - there is a CRAN package mmeta which uses beta-binomial in a Bayesian
> perspective. I did not find the documentation very explicit but there is
> a paper in JSS.
> 
> On 26/11/2015 13:39, Markus Kösters wrote:
> > Dear all,
> >
> > I am currently writing a protocol for a meta-analysis which will
> > analyze suicidal events. Recently, O. Kuss has (DOI 10.1002/sim.6383)
> > published a paper that suggest using beta-binomial regression methods
> > to incorporate double-zero studies. He states that  Methods that
> > ignore information from double-zero studies or use continuity
> > corrections should no longer be used.  It seems obvious to me that
> > excluding studies with zero events will bias the results and I am
> > willing to follow his advice. However, I am not a a biometrician, I
> > have to admit that I am at a loss if and how it is possible to fit
> > such model within the metafor package. Can someone help me or should I
> > use the Yusuf Peto odds ratio method as suggested in the Cochrane
> handbook?
> >
> > Many thanks in advance,
> >
> > Markus
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

[R] metafor - Meta-Analysis of rare events / beta-binomial regression

2015-11-26 Thread Markus Kösters
Dear all,

 

I am currently writing a protocol for a meta-analysis which will analyze
suicidal events. Recently, O. Kuss has (DOI 10.1002/sim.6383) published a
paper that suggest using beta-binomial regression methods to incorporate
double-zero studies. He states that �Methods that ignore information from
double-zero studies or use continuity corrections should no longer be used.�
It seems obvious to me that excluding studies with zero events will bias the
results and I am willing to follow his advice. However, I am not a a
biometrician, I have to admit that I am at a loss if and how it is possible
to fit such model within the metafor package. Can someone help me or should
I use the Yusuf�Peto odds ratio method as suggested in the Cochrane
handbook?

Many thanks in advance,

 

Markus

 

 


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Metafor and forest(); not showing 'ilab' and text

2015-09-01 Thread Michael Dewey

Dear Navien

If anyone on the list is going to help you you need to

1 - provide a minimal, self-contained and reproducible example of your 
problem

2 - start a new thread

Note that in general list members provide help about R rather than 
statistics for which there are other lists.


On 31/08/2015 18:29, Navien wrote:

Dear Wolfgang,

Kindly please i have an issue with R code could you please help me.

Best Regards

On Mon, Aug 31, 2015 at 6:24 PM, Viechtbauer Wolfgang (STAT)-2 [via R] <
ml-node+s789695n4711682...@n4.nabble.com> wrote:


Have you read help(rma.mv)? It describes in detail what "random = ~ 1 |
author" does. Also, I think you may find some of these useful:


http://www.metafor-project.org/doku.php/analyses#multivariate_multilevel_meta-analysis_models

Especially:
http://www.metafor-project.org/doku.php/analyses:konstantopoulos2011

Using "random = ~ 1 | author" is likely to be insufficient. You also need
to add random effects at the observation level.

Best,
Wolfgang

--
Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and

Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD

Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com



-Original Message-
From: Marco Colagrossi [mailto:[hidden email]

<http:///user/SendEmail.jtp?type=node=4711682=0>]

Sent: Monday, August 31, 2015 18:37
To: Michael Dewey
Cc: Viechtbauer Wolfgang (STAT); [hidden email]

<http:///user/SendEmail.jtp?type=node=4711682=1>

Subject: Re: [R] Metafor and forest(); not showing 'ilab' and text

The solution that you proposed works perfectly, thank you very much.

I'll wait for Wolfgang answer as I'm having few doubts about the models.

Thanks

On 31 August 2015 at 18:34, Michael Dewey <[hidden email]

<http:///user/SendEmail.jtp?type=node=4711682=2>>

wrote:

Comments in line

On 31/08/2015 16:08, Marco Colagrossi wrote:


Thanks for your help,

I got the mistake I was making and I managed to find a solution
regarding those graphs; I don't want to abuse of your patience but I
have three further questions:

1. Always regarding the forest plots, it is possible to make a
cross-subset? I try to explain my self better; I have one dummy
variable called pub and another variable called SIMiv that can take
the values of "share", "loan", "number" and "duration". How can I
subset my sample so that the forest shows only (for example) studies
when the dummy takes the value of 1 and the SIMiv variable takes the
values of "share" and "loan"?
Something like this:
forest(pc, var, ci95m, ci95p, slab = authoryear2, psize=1,
subset=(pub==1, SIMiv=("share", "loan", "duration"))



Do you not want something like
(pub == 1) & (SIMIv %in% c("share", "loan", "duration"))



2. I have few doubts regarding the multilevel modeling;
  rma.mv(pc, var, random = ~ 1 | author, data=codebook)
 if I'm correct this should be a multilevel model nested at

"author"

level; what I cannot understand If it is a varying intercept
(Y=A+BjX), a varying slope (Y=Aj+BX) or a varying intercept
model (Y=Aj+BjX). Are there the formulas for it somewhere? So far I
only found the formulas for the estimators included in the metafor
package.



I think it a random intercept but Wolfgang may correct me there.



3. metareg1 <- rma.mv(pc, var, random = ~ 1 | author, mods = ~ pub +
SIMiv, data=codebook)
Again, if I'm correct this should be a multilevel meta regression
(correct me if I'm wrong); I have the same doubts as before.

Thank you again

Marco

On 25 August 2015 at 19:24, Michael Dewey <[hidden email]

<http:///user/SendEmail.jtp?type=node=4711682=3>>

wrote:


Dear Marco

When you change xlim it increases the width of the forest plot in

the

sense
you describe. It does not push your text out of the way to make

space

for

it
but instead overprints it. You may like to use alim to truncate your
confidence interval whiskers to fit within the space you see or make

your

labels shorter.


On 25/08/2015 17:25, Marco Colagrossi wrote:



I think I've not explained myself well. When I say "the width of

the

forest plot" I mean the region above the observed outcome, the
"actual" forest plot, not the plot as a whole. Even if I change

values

for Xlim, cex or ilab.xpos the width of that particular region

within

the plot doesn't change.

Best,

Marco

On 25 August 2015 at 18:11, Viechtbauer Wolfgang (STAT)
<[hidden email]

<http:///user/SendEmail.jtp?type=node=4711682=4>> wrote:



The 'xlim' argument does not change the actual width of the

plotting

device. For that, you need to use the 'width' argument with

whatever

device
you are actually using. You can then use the 'xlim' argument to

create

appropriate spacing to the left/right of the part of the plot that

Re: [R] Metafor and forest(); not showing 'ilab' and text

2015-09-01 Thread Marco Colagrossi
I did read the help(rma.mv) and I also had look at the analysis by
Konstantopoulos (2011) in the past few days. You have to apologize me
but is the first meta analysis I'm trying to carry on, it is the first
I'm working on R and moreover the terminology here is somehow
different (and confusing) with respect to the terminology I was used
in panel data analysis.

It looks to me - correct me if I'm wrong - that a model such:

 rma.mv(pc, var, random = ~ 1 | author, data=codebook)

or

 rma.mv(pc, var, random = ~ 1 | author, mods = ~ pub + SIMiv, data=codebook)

it is a varying intercept model (using Gelman-Hill Yi = Aji+BXi+Ei).
Why do you say that "Using "random = ~ 1 | author" is likely to be
insufficient. You also need to add random effects at the observation
level"? Could you please walk me through what you mean by that?

I'll (try to) explain to you what I'm doing here so you might be able
to help me out.
I'm carrying on a meta-analysis (and ultimately, few meta-regressions)
of the relationship between firm performances and bank-firm
relationship. Since I have different proxies for the latter, I
computed as effect size a raw partial correlation, a continuous
Fisher’s z-score and the one-tail p-value as a continuous
interpretation of the direction and the significance of an effect
size.

The number of studies in my meta-analysis is 29, but most of them have
multiple cases so, ultimately, I have 98 different cases. All of the
29 studies have repeated yearly observation in the same country for
different time span; let's say one from 1985 to 1991 in Spain, one
from 1987 to 1999 in China, one from 1981 to 2002 in the US and so on.
Even in case in which two different study investigates the same
country and some of the years in the time span overlaps I'm sure that
their population is drawn from different samples.

My idea was too confront what in econometrics is called a study-fixed
effect (or author fixed effect since authors have no more than one
study in my analysis), that is:

   rma(pc, var, mods = ~ I(study), data=codebook)

With a multilevel model, in order to account for the fact that
observation from the same study are not independent.

May I have your opinion on what I'm trying to do here guys?
Do you think I should take into account also a autoregressive
structure over time and correct that with struct="HAR" ?

Sorry for the long mail, I wanted to explain as better as possible,
and thank you again for your help, It is incredibly appreciated.

Marco

On 31 August 2015 at 19:28, Viechtbauer Wolfgang (STAT)
<wolfgang.viechtba...@maastrichtuniversity.nl> wrote:
> Have you read help(rma.mv)? It describes in detail what "random = ~ 1 | 
> author" does. Also, I think you may find some of these useful:
>
> http://www.metafor-project.org/doku.php/analyses#multivariate_multilevel_meta-analysis_models
>
> Especially: 
> http://www.metafor-project.org/doku.php/analyses:konstantopoulos2011
>
> Using "random = ~ 1 | author" is likely to be insufficient. You also need to 
> add random effects at the observation level.
>
> Best,
> Wolfgang
>
> --
> Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
> Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
> Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com
>
>> -Original Message-
>> From: Marco Colagrossi [mailto:marco.colagro...@gmail.com]
>> Sent: Monday, August 31, 2015 18:37
>> To: Michael Dewey
>> Cc: Viechtbauer Wolfgang (STAT); r-help@r-project.org
>> Subject: Re: [R] Metafor and forest(); not showing 'ilab' and text
>>
>> The solution that you proposed works perfectly, thank you very much.
>>
>> I'll wait for Wolfgang answer as I'm having few doubts about the models.
>>
>> Thanks
>>
>> On 31 August 2015 at 18:34, Michael Dewey <li...@dewey.myzen.co.uk>
>> wrote:
>> > Comments in line
>> >
>> > On 31/08/2015 16:08, Marco Colagrossi wrote:
>> >>
>> >> Thanks for your help,
>> >>
>> >> I got the mistake I was making and I managed to find a solution
>> >> regarding those graphs; I don't want to abuse of your patience but I
>> >> have three further questions:
>> >>
>> >> 1. Always regarding the forest plots, it is possible to make a
>> >> cross-subset? I try to explain my self better; I have one dummy
>> >> variable called pub and another variable called SIMiv that can take
>> >> the values of "share", "loan", "number" and "duration". How can I
>> >> subset my sample so that the forest shows only (for example) studies
>> >> when the dummy takes the value

Re: [R] Metafor and forest(); not showing 'ilab' and text

2015-08-31 Thread Marco Colagrossi
Thanks for your help,

I got the mistake I was making and I managed to find a solution
regarding those graphs; I don't want to abuse of your patience but I
have three further questions:

1. Always regarding the forest plots, it is possible to make a
cross-subset? I try to explain my self better; I have one dummy
variable called pub and another variable called SIMiv that can take
the values of "share", "loan", "number" and "duration". How can I
subset my sample so that the forest shows only (for example) studies
when the dummy takes the value of 1 and the SIMiv variable takes the
values of "share" and "loan"?
Something like this:
forest(pc, var, ci95m, ci95p, slab = authoryear2, psize=1,
subset=(pub==1, SIMiv=("share", "loan", "duration"))

2. I have few doubts regarding the multilevel modeling;
rma.mv(pc, var, random = ~ 1 | author, data=codebook)
   if I'm correct this should be a multilevel model nested at "author"
level; what I cannot understand If it is a varying intercept
(Y=A+BjX), a varying slope (Y=Aj+BX) or a varying intercept
model (Y=Aj+BjX). Are there the formulas for it somewhere? So far I
only found the formulas for the estimators included in the metafor
package.

3. metareg1 <- rma.mv(pc, var, random = ~ 1 | author, mods = ~ pub +
SIMiv, data=codebook)
Again, if I'm correct this should be a multilevel meta regression
(correct me if I'm wrong); I have the same doubts as before.

Thank you again

Marco

On 25 August 2015 at 19:24, Michael Dewey <li...@dewey.myzen.co.uk> wrote:
> Dear Marco
>
> When you change xlim it increases the width of the forest plot in the sense
> you describe. It does not push your text out of the way to make space for it
> but instead overprints it. You may like to use alim to truncate your
> confidence interval whiskers to fit within the space you see or make your
> labels shorter.
>
>
> On 25/08/2015 17:25, Marco Colagrossi wrote:
>>
>> I think I've not explained myself well. When I say "the width of the
>> forest plot" I mean the region above the observed outcome, the
>> "actual" forest plot, not the plot as a whole. Even if I change values
>> for Xlim, cex or ilab.xpos the width of that particular region within
>> the plot doesn't change.
>>
>> Best,
>>
>> Marco
>>
>> On 25 August 2015 at 18:11, Viechtbauer Wolfgang (STAT)
>> <wolfgang.viechtba...@maastrichtuniversity.nl> wrote:
>>>
>>> The 'xlim' argument does not change the actual width of the plotting
>>> device. For that, you need to use the 'width' argument with whatever device
>>> you are actually using. You can then use the 'xlim' argument to create
>>> appropriate spacing to the left/right of the part of the plot that shows the
>>> estimates and their CIs. Within that space, you can then add additional
>>> columns with the 'ilab' argument. It's up to you to find an appropriate
>>> combination of plotting device width, character/symbol expansion factor
>>> ('cex' argument), 'xlim' values, and 'ilab.xpos' values to create a nice
>>> looking plot that has no overlapping text and no excessive white space. An
>>> example is this:
>>>
>>> http://www.metafor-project.org/doku.php/plots:forest_plot_with_subgroups
>>>
>>> Note that it took me dozens of iterations to create that plot. You just
>>> have to start experimenting.
>>>
>>> Best,
>>> Wolfgang
>>>
>>>> -Original Message-
>>>> From: Marco Colagrossi [mailto:marco.colagro...@gmail.com]
>>>> Sent: Tuesday, August 25, 2015 17:59
>>>> To: Viechtbauer Wolfgang (STAT)
>>>> Cc: r-help@r-project.org; Michael Dewey
>>>> Subject: Re: [R] Metafor and forest(); not showing 'ilab' and text
>>>>
>>>> Thanks again for your help. I'm sorry to bother you but I don't get
>>>> how to widen the forest plot; if I try to change the values of xlim or
>>>> the ilab.xpos values the width of the forest plot region does not
>>>> change, but only moves on the graphs. What I'm I missing?
>>>>
>>>>
>>>> forest(pc, var, ci95m, ci95p, slab = authoryear, psize=1,
>>>> subset=(pub==1),
>>>> xlim = c(-16, 6),
>>>> ilab = data.frame(SIMdv, SIMiv),
>>>> ilab.xpos = c(-7.5, -5.5), cex = 0.75)
>>>> op <- par(cex=.75, font=2)
>>>>text(c(-7.5, -5.5), 54, c("DV", "IV"))
>>>>text(-16,54, "Author(s) and Year", pos=4)
>>>>text(6,  54, "Outcome [95% CI]", pos=2)
>>>> par(op)
>>>>>
>>>>> par("usr")[1:2]
>>>>
>>>> [1] -16   6
>
>
> --
> Michael
> http://www.dewey.myzen.co.uk/home.html

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Metafor and forest(); not showing 'ilab' and text

2015-08-31 Thread Michael Dewey

Comments in line

On 31/08/2015 16:08, Marco Colagrossi wrote:

Thanks for your help,

I got the mistake I was making and I managed to find a solution
regarding those graphs; I don't want to abuse of your patience but I
have three further questions:

1. Always regarding the forest plots, it is possible to make a
cross-subset? I try to explain my self better; I have one dummy
variable called pub and another variable called SIMiv that can take
the values of "share", "loan", "number" and "duration". How can I
subset my sample so that the forest shows only (for example) studies
when the dummy takes the value of 1 and the SIMiv variable takes the
values of "share" and "loan"?
Something like this:
forest(pc, var, ci95m, ci95p, slab = authoryear2, psize=1,
subset=(pub==1, SIMiv=("share", "loan", "duration"))



Do you not want something like
(pub == 1) & (SIMIv %in% c("share", "loan", "duration"))



2. I have few doubts regarding the multilevel modeling;
 rma.mv(pc, var, random = ~ 1 | author, data=codebook)
if I'm correct this should be a multilevel model nested at "author"
level; what I cannot understand If it is a varying intercept
(Y=A+BjX), a varying slope (Y=Aj+BX) or a varying intercept
model (Y=Aj+BjX). Are there the formulas for it somewhere? So far I
only found the formulas for the estimators included in the metafor
package.



I think it a random intercept but Wolfgang may correct me there.


3. metareg1 <- rma.mv(pc, var, random = ~ 1 | author, mods = ~ pub +
SIMiv, data=codebook)
Again, if I'm correct this should be a multilevel meta regression
(correct me if I'm wrong); I have the same doubts as before.

Thank you again

Marco

On 25 August 2015 at 19:24, Michael Dewey <li...@dewey.myzen.co.uk> wrote:

Dear Marco

When you change xlim it increases the width of the forest plot in the sense
you describe. It does not push your text out of the way to make space for it
but instead overprints it. You may like to use alim to truncate your
confidence interval whiskers to fit within the space you see or make your
labels shorter.


On 25/08/2015 17:25, Marco Colagrossi wrote:


I think I've not explained myself well. When I say "the width of the
forest plot" I mean the region above the observed outcome, the
"actual" forest plot, not the plot as a whole. Even if I change values
for Xlim, cex or ilab.xpos the width of that particular region within
the plot doesn't change.

Best,

Marco

On 25 August 2015 at 18:11, Viechtbauer Wolfgang (STAT)
<wolfgang.viechtba...@maastrichtuniversity.nl> wrote:


The 'xlim' argument does not change the actual width of the plotting
device. For that, you need to use the 'width' argument with whatever device
you are actually using. You can then use the 'xlim' argument to create
appropriate spacing to the left/right of the part of the plot that shows the
estimates and their CIs. Within that space, you can then add additional
columns with the 'ilab' argument. It's up to you to find an appropriate
combination of plotting device width, character/symbol expansion factor
('cex' argument), 'xlim' values, and 'ilab.xpos' values to create a nice
looking plot that has no overlapping text and no excessive white space. An
example is this:

http://www.metafor-project.org/doku.php/plots:forest_plot_with_subgroups

Note that it took me dozens of iterations to create that plot. You just
have to start experimenting.

Best,
Wolfgang


-Original Message-
From: Marco Colagrossi [mailto:marco.colagro...@gmail.com]
Sent: Tuesday, August 25, 2015 17:59
To: Viechtbauer Wolfgang (STAT)
Cc: r-help@r-project.org; Michael Dewey
Subject: Re: [R] Metafor and forest(); not showing 'ilab' and text

Thanks again for your help. I'm sorry to bother you but I don't get
how to widen the forest plot; if I try to change the values of xlim or
the ilab.xpos values the width of the forest plot region does not
change, but only moves on the graphs. What I'm I missing?


forest(pc, var, ci95m, ci95p, slab = authoryear, psize=1,
subset=(pub==1),
 xlim = c(-16, 6),
 ilab = data.frame(SIMdv, SIMiv),
 ilab.xpos = c(-7.5, -5.5), cex = 0.75)
op <- par(cex=.75, font=2)
text(c(-7.5, -5.5), 54, c("DV", "IV"))
text(-16,54, "Author(s) and Year", pos=4)
text(6,  54, "Outcome [95% CI]", pos=2)
par(op)


par("usr")[1:2]


[1] -16   6



--
Michael
http://www.dewey.myzen.co.uk/home.html




--
Michael
http://www.dewey.myzen.co.uk/home.html

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Metafor and forest(); not showing 'ilab' and text

2015-08-31 Thread Marco Colagrossi
The solution that you proposed works perfectly, thank you very much.

I'll wait for Wolfgang answer as I'm having few doubts about the models.

Thanks

On 31 August 2015 at 18:34, Michael Dewey <li...@dewey.myzen.co.uk> wrote:
> Comments in line
>
> On 31/08/2015 16:08, Marco Colagrossi wrote:
>>
>> Thanks for your help,
>>
>> I got the mistake I was making and I managed to find a solution
>> regarding those graphs; I don't want to abuse of your patience but I
>> have three further questions:
>>
>> 1. Always regarding the forest plots, it is possible to make a
>> cross-subset? I try to explain my self better; I have one dummy
>> variable called pub and another variable called SIMiv that can take
>> the values of "share", "loan", "number" and "duration". How can I
>> subset my sample so that the forest shows only (for example) studies
>> when the dummy takes the value of 1 and the SIMiv variable takes the
>> values of "share" and "loan"?
>> Something like this:
>> forest(pc, var, ci95m, ci95p, slab = authoryear2, psize=1,
>> subset=(pub==1, SIMiv=("share", "loan", "duration"))
>>
>
> Do you not want something like
> (pub == 1) & (SIMIv %in% c("share", "loan", "duration"))
>
>
>> 2. I have few doubts regarding the multilevel modeling;
>>  rma.mv(pc, var, random = ~ 1 | author, data=codebook)
>> if I'm correct this should be a multilevel model nested at "author"
>> level; what I cannot understand If it is a varying intercept
>> (Y=A+BjX), a varying slope (Y=Aj+BX) or a varying intercept
>> model (Y=Aj+BjX). Are there the formulas for it somewhere? So far I
>> only found the formulas for the estimators included in the metafor
>> package.
>>
>
> I think it a random intercept but Wolfgang may correct me there.
>
>
>> 3. metareg1 <- rma.mv(pc, var, random = ~ 1 | author, mods = ~ pub +
>> SIMiv, data=codebook)
>> Again, if I'm correct this should be a multilevel meta regression
>> (correct me if I'm wrong); I have the same doubts as before.
>>
>> Thank you again
>>
>> Marco
>>
>> On 25 August 2015 at 19:24, Michael Dewey <li...@dewey.myzen.co.uk> wrote:
>>>
>>> Dear Marco
>>>
>>> When you change xlim it increases the width of the forest plot in the
>>> sense
>>> you describe. It does not push your text out of the way to make space for
>>> it
>>> but instead overprints it. You may like to use alim to truncate your
>>> confidence interval whiskers to fit within the space you see or make your
>>> labels shorter.
>>>
>>>
>>> On 25/08/2015 17:25, Marco Colagrossi wrote:
>>>>
>>>>
>>>> I think I've not explained myself well. When I say "the width of the
>>>> forest plot" I mean the region above the observed outcome, the
>>>> "actual" forest plot, not the plot as a whole. Even if I change values
>>>> for Xlim, cex or ilab.xpos the width of that particular region within
>>>> the plot doesn't change.
>>>>
>>>> Best,
>>>>
>>>> Marco
>>>>
>>>> On 25 August 2015 at 18:11, Viechtbauer Wolfgang (STAT)
>>>> <wolfgang.viechtba...@maastrichtuniversity.nl> wrote:
>>>>>
>>>>>
>>>>> The 'xlim' argument does not change the actual width of the plotting
>>>>> device. For that, you need to use the 'width' argument with whatever
>>>>> device
>>>>> you are actually using. You can then use the 'xlim' argument to create
>>>>> appropriate spacing to the left/right of the part of the plot that
>>>>> shows the
>>>>> estimates and their CIs. Within that space, you can then add additional
>>>>> columns with the 'ilab' argument. It's up to you to find an appropriate
>>>>> combination of plotting device width, character/symbol expansion factor
>>>>> ('cex' argument), 'xlim' values, and 'ilab.xpos' values to create a
>>>>> nice
>>>>> looking plot that has no overlapping text and no excessive white space.
>>>>> An
>>>>> example is this:
>>>>>
>>>>>
>>>>> http://www.metafor-project.org/doku.php/plots:forest_plot_with_subgroups
>>>>>
>>>>> Note that it took me dozens of iterations to create that plot. You just
>>>&g

Re: [R] Metafor and forest(); not showing 'ilab' and text

2015-08-31 Thread Viechtbauer Wolfgang (STAT)
Have you read help(rma.mv)? It describes in detail what "random = ~ 1 | author" 
does. Also, I think you may find some of these useful:

http://www.metafor-project.org/doku.php/analyses#multivariate_multilevel_meta-analysis_models

Especially: http://www.metafor-project.org/doku.php/analyses:konstantopoulos2011

Using "random = ~ 1 | author" is likely to be insufficient. You also need to 
add random effects at the observation level.

Best,
Wolfgang

-- 
Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com

> -Original Message-
> From: Marco Colagrossi [mailto:marco.colagro...@gmail.com]
> Sent: Monday, August 31, 2015 18:37
> To: Michael Dewey
> Cc: Viechtbauer Wolfgang (STAT); r-help@r-project.org
> Subject: Re: [R] Metafor and forest(); not showing 'ilab' and text
> 
> The solution that you proposed works perfectly, thank you very much.
> 
> I'll wait for Wolfgang answer as I'm having few doubts about the models.
> 
> Thanks
> 
> On 31 August 2015 at 18:34, Michael Dewey <li...@dewey.myzen.co.uk>
> wrote:
> > Comments in line
> >
> > On 31/08/2015 16:08, Marco Colagrossi wrote:
> >>
> >> Thanks for your help,
> >>
> >> I got the mistake I was making and I managed to find a solution
> >> regarding those graphs; I don't want to abuse of your patience but I
> >> have three further questions:
> >>
> >> 1. Always regarding the forest plots, it is possible to make a
> >> cross-subset? I try to explain my self better; I have one dummy
> >> variable called pub and another variable called SIMiv that can take
> >> the values of "share", "loan", "number" and "duration". How can I
> >> subset my sample so that the forest shows only (for example) studies
> >> when the dummy takes the value of 1 and the SIMiv variable takes the
> >> values of "share" and "loan"?
> >> Something like this:
> >> forest(pc, var, ci95m, ci95p, slab = authoryear2, psize=1,
> >> subset=(pub==1, SIMiv=("share", "loan", "duration"))
> >>
> >
> > Do you not want something like
> > (pub == 1) & (SIMIv %in% c("share", "loan", "duration"))
> >
> >
> >> 2. I have few doubts regarding the multilevel modeling;
> >>  rma.mv(pc, var, random = ~ 1 | author, data=codebook)
> >> if I'm correct this should be a multilevel model nested at
> "author"
> >> level; what I cannot understand If it is a varying intercept
> >> (Y=A+BjX), a varying slope (Y=Aj+BX) or a varying intercept
> >> model (Y=Aj+BjX). Are there the formulas for it somewhere? So far I
> >> only found the formulas for the estimators included in the metafor
> >> package.
> >>
> >
> > I think it a random intercept but Wolfgang may correct me there.
> >
> >
> >> 3. metareg1 <- rma.mv(pc, var, random = ~ 1 | author, mods = ~ pub +
> >> SIMiv, data=codebook)
> >> Again, if I'm correct this should be a multilevel meta regression
> >> (correct me if I'm wrong); I have the same doubts as before.
> >>
> >> Thank you again
> >>
> >> Marco
> >>
> >> On 25 August 2015 at 19:24, Michael Dewey <li...@dewey.myzen.co.uk>
> wrote:
> >>>
> >>> Dear Marco
> >>>
> >>> When you change xlim it increases the width of the forest plot in the
> >>> sense
> >>> you describe. It does not push your text out of the way to make space
> for
> >>> it
> >>> but instead overprints it. You may like to use alim to truncate your
> >>> confidence interval whiskers to fit within the space you see or make
> your
> >>> labels shorter.
> >>>
> >>>
> >>> On 25/08/2015 17:25, Marco Colagrossi wrote:
> >>>>
> >>>>
> >>>> I think I've not explained myself well. When I say "the width of the
> >>>> forest plot" I mean the region above the observed outcome, the
> >>>> "actual" forest plot, not the plot as a whole. Even if I change
> values
> >>>> for Xlim, cex or ilab.xpos the width of that particular region
> within
> >>>> the plot doesn't change.
> >>>>
> >>>> Best,
> >>>>
> >>>> Mar

Re: [R] Metafor and forest(); not showing 'ilab' and text

2015-08-31 Thread Navien
Dear Wolfgang,

Kindly please i have an issue with R code could you please help me.

Best Regards

On Mon, Aug 31, 2015 at 6:24 PM, Viechtbauer Wolfgang (STAT)-2 [via R] <
ml-node+s789695n4711682...@n4.nabble.com> wrote:

> Have you read help(rma.mv)? It describes in detail what "random = ~ 1 |
> author" does. Also, I think you may find some of these useful:
>
>
> http://www.metafor-project.org/doku.php/analyses#multivariate_multilevel_meta-analysis_models
>
> Especially:
> http://www.metafor-project.org/doku.php/analyses:konstantopoulos2011
>
> Using "random = ~ 1 | author" is likely to be insufficient. You also need
> to add random effects at the observation level.
>
> Best,
> Wolfgang
>
> --
> Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
>
> Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
>
> Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com
>
>
> > -Original Message-
> > From: Marco Colagrossi [mailto:[hidden email]
> <http:///user/SendEmail.jtp?type=node=4711682=0>]
> > Sent: Monday, August 31, 2015 18:37
> > To: Michael Dewey
> > Cc: Viechtbauer Wolfgang (STAT); [hidden email]
> <http:///user/SendEmail.jtp?type=node=4711682=1>
> > Subject: Re: [R] Metafor and forest(); not showing 'ilab' and text
> >
> > The solution that you proposed works perfectly, thank you very much.
> >
> > I'll wait for Wolfgang answer as I'm having few doubts about the models.
> >
> > Thanks
> >
> > On 31 August 2015 at 18:34, Michael Dewey <[hidden email]
> <http:///user/SendEmail.jtp?type=node=4711682=2>>
> > wrote:
> > > Comments in line
> > >
> > > On 31/08/2015 16:08, Marco Colagrossi wrote:
> > >>
> > >> Thanks for your help,
> > >>
> > >> I got the mistake I was making and I managed to find a solution
> > >> regarding those graphs; I don't want to abuse of your patience but I
> > >> have three further questions:
> > >>
> > >> 1. Always regarding the forest plots, it is possible to make a
> > >> cross-subset? I try to explain my self better; I have one dummy
> > >> variable called pub and another variable called SIMiv that can take
> > >> the values of "share", "loan", "number" and "duration". How can I
> > >> subset my sample so that the forest shows only (for example) studies
> > >> when the dummy takes the value of 1 and the SIMiv variable takes the
> > >> values of "share" and "loan"?
> > >> Something like this:
> > >> forest(pc, var, ci95m, ci95p, slab = authoryear2, psize=1,
> > >> subset=(pub==1, SIMiv=("share", "loan", "duration"))
> > >>
> > >
> > > Do you not want something like
> > > (pub == 1) & (SIMIv %in% c("share", "loan", "duration"))
> > >
> > >
> > >> 2. I have few doubts regarding the multilevel modeling;
> > >>  rma.mv(pc, var, random = ~ 1 | author, data=codebook)
> > >> if I'm correct this should be a multilevel model nested at
> > "author"
> > >> level; what I cannot understand If it is a varying intercept
> > >> (Y=A+BjX), a varying slope (Y=Aj+BX) or a varying intercept
> > >> model (Y=Aj+BjX). Are there the formulas for it somewhere? So far I
> > >> only found the formulas for the estimators included in the metafor
> > >> package.
> > >>
> > >
> > > I think it a random intercept but Wolfgang may correct me there.
> > >
> > >
> > >> 3. metareg1 <- rma.mv(pc, var, random = ~ 1 | author, mods = ~ pub +
> > >> SIMiv, data=codebook)
> > >> Again, if I'm correct this should be a multilevel meta regression
> > >> (correct me if I'm wrong); I have the same doubts as before.
> > >>
> > >> Thank you again
> > >>
> > >> Marco
> > >>
> > >> On 25 August 2015 at 19:24, Michael Dewey <[hidden email]
> <http:///user/SendEmail.jtp?type=node=4711682=3>>
> > wrote:
> > >>>
> > >>> Dear Marco
> > >>>
> > >>> When you change xlim it increases the width of the forest plot in
> the
> > >>> sense
> > >>> you describe. It does not push your text out of the way to make
> space
> > for
> > >>> i

Re: [R] Metafor and forest(); not showing 'ilab' and text

2015-08-25 Thread Viechtbauer Wolfgang (STAT)
The 'xlim' argument does not change the actual width of the plotting device. 
For that, you need to use the 'width' argument with whatever device you are 
actually using. You can then use the 'xlim' argument to create appropriate 
spacing to the left/right of the part of the plot that shows the estimates and 
their CIs. Within that space, you can then add additional columns with the 
'ilab' argument. It's up to you to find an appropriate combination of plotting 
device width, character/symbol expansion factor ('cex' argument), 'xlim' 
values, and 'ilab.xpos' values to create a nice looking plot that has no 
overlapping text and no excessive white space. An example is this:

http://www.metafor-project.org/doku.php/plots:forest_plot_with_subgroups 

Note that it took me dozens of iterations to create that plot. You just have to 
start experimenting.

Best,
Wolfgang

 -Original Message-
 From: Marco Colagrossi [mailto:marco.colagro...@gmail.com]
 Sent: Tuesday, August 25, 2015 17:59
 To: Viechtbauer Wolfgang (STAT)
 Cc: r-help@r-project.org; Michael Dewey
 Subject: Re: [R] Metafor and forest(); not showing 'ilab' and text
 
 Thanks again for your help. I'm sorry to bother you but I don't get
 how to widen the forest plot; if I try to change the values of xlim or
 the ilab.xpos values the width of the forest plot region does not
 change, but only moves on the graphs. What I'm I missing?
 
 
 forest(pc, var, ci95m, ci95p, slab = authoryear, psize=1,
 subset=(pub==1),
xlim = c(-16, 6),
ilab = data.frame(SIMdv, SIMiv),
ilab.xpos = c(-7.5, -5.5), cex = 0.75)
 op - par(cex=.75, font=2)
   text(c(-7.5, -5.5), 54, c(DV, IV))
   text(-16,54, Author(s) and Year, pos=4)
   text(6,  54, Outcome [95% CI], pos=2)
 par(op)
  par(usr)[1:2]
 [1] -16   6
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Metafor and forest(); not showing 'ilab' and text

2015-08-25 Thread Marco Colagrossi
Thanks again for your help. I'm sorry to bother you but I don't get
how to widen the forest plot; if I try to change the values of xlim or
the ilab.xpos values the width of the forest plot region does not
change, but only moves on the graphs. What I'm I missing?


forest(pc, var, ci95m, ci95p, slab = authoryear, psize=1, subset=(pub==1),
   xlim = c(-16, 6),
   ilab = data.frame(SIMdv, SIMiv),
   ilab.xpos = c(-7.5, -5.5), cex = 0.75)
op - par(cex=.75, font=2)
  text(c(-7.5, -5.5), 54, c(DV, IV))
  text(-16,54, Author(s) and Year, pos=4)
  text(6,  54, Outcome [95% CI], pos=2)
par(op)
 par(usr)[1:2]
[1] -16   6

On 25 August 2015 at 15:54, Viechtbauer Wolfgang (STAT)
wolfgang.viechtba...@maastrichtuniversity.nl wrote:
 Further comments in line as well.

 -Original Message-
 From: Michael Dewey [mailto:li...@dewey.myzen.co.uk]
 Sent: Tuesday, August 25, 2015 13:23
 To: Marco Colagrossi; Viechtbauer Wolfgang (STAT)
 Cc: r-help@r-project.org
 Subject: Re: [R] Metafor and forest(); not showing 'ilab' and text

 Hello Marco

 Comments in line again

 On 24/08/2015 18:49, Marco Colagrossi wrote:
  I tried to upload the file once again. I tweaked it a bit, now my code
 is:
 
  forest(pc, var, ci95m, ci95p, slab = authoryear, psize=1,
 subset=(pub==1),
  xlim = c(-16, 6),
  ilab = cbind(SIMdv, SIMiv),
  ilab.xpos = c(-7.5, -5.5), cex = 0.75)
  op - par(cex=.75, font=2)
 text(c(-7.5, -5.5), 54, c(DV, IV))
 text(-16,54, Author(s) and Year, pos=4)
 text(6,  54, Outcome [95% CI], pos=2)
  par(op)
 
  I managed to show both the Ilab argument and the text above. I still
  have 3 issues:
  - now the forest plot is too narrow - that is, pretty unreadable;

 You need to re-read Wolfgang's advice again. The forest function tells
 you what values of xlim it used and you can then adjust them to suit.
 This will take a few attempts in my experience.

  - I cannot still export it properly, as shown in the enclosed .png

 It looked correctly exported to me. One comment, do you really need the
 complete citation of each study? Most of the forest plots I see as a
 reviewer just use the first author name and the year. This would
 potentially give you a lot more space.

 Also, if you have lots of outcomes, you may need to increase the height of 
 the plotting device to make everything fit (or you need to reduce the font 
 size even further, but things will become illegible eventually).

  - SIMdv, SIMiv are shown as number while on mine .csv are actually
  text variable.

 Those variables are apparently coded as factors, so use data.frame() instead 
 of cbind() to avoid the coercion to integer codes.

  regarding the rma.mv package, I set it up this way (preliminarily)
 

 I will leave this one to Wolfgang to answer.

  multi - rma.mv(pc, var, random = ~ 1 | author, data=codebook)
 
  I'm trying to compare the results with this equation, which is what -
  I think, correct me if I'm wrong -  in econometrics we call
  author-fixed effect, that is, model which are constant across
  individuals (the random\fix notation is a bit tricky):
 
  author_fix - rma(pc, var, mods = ~ I(author), data=codebook,
 method=ML)
 
  What I was wondering if that the two equation above mentioned also
  correct for heteroskedasticity which I need since my studies have
  different sample and specifications.

 I cannot comment on model choices. But yes, the functions properly account 
 for the fact that the sampling variances are heteroskedastic.

  Thanks for your help, your patience and your time, and many
  compliments for the package, is guiding me through the use of R for
  the first time - as you might have guessed.
 
  Marco
 
 
  On 24 August 2015 at 16:50, Viechtbauer Wolfgang (STAT)
  wolfgang.viechtba...@maastrichtuniversity.nl wrote:
  I cannot reproduce the issue with 'ilab' not being shown when using
 'subset'. My guess is that the values for 'ilab.xpos' specified are
 actually outside of the plotting region. After you have drawn the forest
 plot, try:
 
  par(usr)[1:2]
 
  to see what the default limits actually are. Then use 'xlim' to adjust
 the limits to your taste. And then use appropriate values for
 'ilab.xpos', so they are inside those limits.
 
  Moreover, the graph is showed correctly only within the zoom in
  Rstudio but if I save it it is showed as enclosed.
 
  Nothing was enclosed (or it was stripped).
 
  Moreover, how would you suggest to handle (graphically) the
  multiple-cases-per-study thing? It's a 'good' way to average the
 cases
  among different studies in the graphs?
 
  Maybe add some space between groupings (i.e., studies). The example
 given here can provide some clues how one could go about this:
 http://www.metafor-project.org/doku.php/plots:forest_plot_with_subgroups
 But drawing a plot like this requires a lot of hand-tweaking.
 
  Best,
  Wolfgang

Re: [R] Metafor and forest(); not showing 'ilab' and text

2015-08-25 Thread Michael Dewey

Dear Marco

When you change xlim it increases the width of the forest plot in the 
sense you describe. It does not push your text out of the way to make 
space for it but instead overprints it. You may like to use alim to 
truncate your confidence interval whiskers to fit within the space you 
see or make your labels shorter.


On 25/08/2015 17:25, Marco Colagrossi wrote:

I think I've not explained myself well. When I say the width of the
forest plot I mean the region above the observed outcome, the
actual forest plot, not the plot as a whole. Even if I change values
for Xlim, cex or ilab.xpos the width of that particular region within
the plot doesn't change.

Best,

Marco

On 25 August 2015 at 18:11, Viechtbauer Wolfgang (STAT)
wolfgang.viechtba...@maastrichtuniversity.nl wrote:

The 'xlim' argument does not change the actual width of the plotting device. 
For that, you need to use the 'width' argument with whatever device you are 
actually using. You can then use the 'xlim' argument to create appropriate 
spacing to the left/right of the part of the plot that shows the estimates and 
their CIs. Within that space, you can then add additional columns with the 
'ilab' argument. It's up to you to find an appropriate combination of plotting 
device width, character/symbol expansion factor ('cex' argument), 'xlim' 
values, and 'ilab.xpos' values to create a nice looking plot that has no 
overlapping text and no excessive white space. An example is this:

http://www.metafor-project.org/doku.php/plots:forest_plot_with_subgroups

Note that it took me dozens of iterations to create that plot. You just have to 
start experimenting.

Best,
Wolfgang


-Original Message-
From: Marco Colagrossi [mailto:marco.colagro...@gmail.com]
Sent: Tuesday, August 25, 2015 17:59
To: Viechtbauer Wolfgang (STAT)
Cc: r-help@r-project.org; Michael Dewey
Subject: Re: [R] Metafor and forest(); not showing 'ilab' and text

Thanks again for your help. I'm sorry to bother you but I don't get
how to widen the forest plot; if I try to change the values of xlim or
the ilab.xpos values the width of the forest plot region does not
change, but only moves on the graphs. What I'm I missing?


forest(pc, var, ci95m, ci95p, slab = authoryear, psize=1,
subset=(pub==1),
xlim = c(-16, 6),
ilab = data.frame(SIMdv, SIMiv),
ilab.xpos = c(-7.5, -5.5), cex = 0.75)
op - par(cex=.75, font=2)
   text(c(-7.5, -5.5), 54, c(DV, IV))
   text(-16,54, Author(s) and Year, pos=4)
   text(6,  54, Outcome [95% CI], pos=2)
par(op)

par(usr)[1:2]

[1] -16   6


--
Michael
http://www.dewey.myzen.co.uk/home.html

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Metafor and forest(); not showing 'ilab' and text

2015-08-25 Thread Viechtbauer Wolfgang (STAT)
Further comments in line as well.

 -Original Message-
 From: Michael Dewey [mailto:li...@dewey.myzen.co.uk]
 Sent: Tuesday, August 25, 2015 13:23
 To: Marco Colagrossi; Viechtbauer Wolfgang (STAT)
 Cc: r-help@r-project.org
 Subject: Re: [R] Metafor and forest(); not showing 'ilab' and text
 
 Hello Marco
 
 Comments in line again
 
 On 24/08/2015 18:49, Marco Colagrossi wrote:
  I tried to upload the file once again. I tweaked it a bit, now my code
 is:
 
  forest(pc, var, ci95m, ci95p, slab = authoryear, psize=1,
 subset=(pub==1),
  xlim = c(-16, 6),
  ilab = cbind(SIMdv, SIMiv),
  ilab.xpos = c(-7.5, -5.5), cex = 0.75)
  op - par(cex=.75, font=2)
 text(c(-7.5, -5.5), 54, c(DV, IV))
 text(-16,54, Author(s) and Year, pos=4)
 text(6,  54, Outcome [95% CI], pos=2)
  par(op)
 
  I managed to show both the Ilab argument and the text above. I still
  have 3 issues:
  - now the forest plot is too narrow - that is, pretty unreadable;
 
 You need to re-read Wolfgang's advice again. The forest function tells
 you what values of xlim it used and you can then adjust them to suit.
 This will take a few attempts in my experience.
 
  - I cannot still export it properly, as shown in the enclosed .png
 
 It looked correctly exported to me. One comment, do you really need the
 complete citation of each study? Most of the forest plots I see as a
 reviewer just use the first author name and the year. This would
 potentially give you a lot more space.

Also, if you have lots of outcomes, you may need to increase the height of the 
plotting device to make everything fit (or you need to reduce the font size 
even further, but things will become illegible eventually).

  - SIMdv, SIMiv are shown as number while on mine .csv are actually
  text variable.

Those variables are apparently coded as factors, so use data.frame() instead of 
cbind() to avoid the coercion to integer codes.

  regarding the rma.mv package, I set it up this way (preliminarily)
 
 
 I will leave this one to Wolfgang to answer.
 
  multi - rma.mv(pc, var, random = ~ 1 | author, data=codebook)
 
  I'm trying to compare the results with this equation, which is what -
  I think, correct me if I'm wrong -  in econometrics we call
  author-fixed effect, that is, model which are constant across
  individuals (the random\fix notation is a bit tricky):
 
  author_fix - rma(pc, var, mods = ~ I(author), data=codebook,
 method=ML)
 
  What I was wondering if that the two equation above mentioned also
  correct for heteroskedasticity which I need since my studies have
  different sample and specifications.

I cannot comment on model choices. But yes, the functions properly account for 
the fact that the sampling variances are heteroskedastic.

  Thanks for your help, your patience and your time, and many
  compliments for the package, is guiding me through the use of R for
  the first time - as you might have guessed.
 
  Marco
 
 
  On 24 August 2015 at 16:50, Viechtbauer Wolfgang (STAT)
  wolfgang.viechtba...@maastrichtuniversity.nl wrote:
  I cannot reproduce the issue with 'ilab' not being shown when using
 'subset'. My guess is that the values for 'ilab.xpos' specified are
 actually outside of the plotting region. After you have drawn the forest
 plot, try:
 
  par(usr)[1:2]
 
  to see what the default limits actually are. Then use 'xlim' to adjust
 the limits to your taste. And then use appropriate values for
 'ilab.xpos', so they are inside those limits.
 
  Moreover, the graph is showed correctly only within the zoom in
  Rstudio but if I save it it is showed as enclosed.
 
  Nothing was enclosed (or it was stripped).
 
  Moreover, how would you suggest to handle (graphically) the
  multiple-cases-per-study thing? It's a 'good' way to average the
 cases
  among different studies in the graphs?
 
  Maybe add some space between groupings (i.e., studies). The example
 given here can provide some clues how one could go about this:
 http://www.metafor-project.org/doku.php/plots:forest_plot_with_subgroups
 But drawing a plot like this requires a lot of hand-tweaking.
 
  Best,
  Wolfgang
 
  --
  Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry
 and
  Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200
 MD
  Maastricht, The Netherlands | +31 (43) 388-4170 |
 http://www.wvbauer.com
 
  -Original Message-
  From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Marco
  Colagrossi
  Sent: Monday, August 24, 2015 16:04
  To: r-help@r-project.org
  Subject: [R] Metafor and forest(); not showing 'ilab' and text
 
  Hello folks,
 
  I have a couple of issues with the metafor package, specifically with
  the forest graphs.
  I am currently conducting a Meta-Analysis in economics throughout the
  metafor package.
 
  My meta-analysis has the specific of having different cases from
  single studies, and this proven

Re: [R] Metafor and forest(); not showing 'ilab' and text

2015-08-25 Thread Michael Dewey

Hello Marco

Comments in line again

On 24/08/2015 18:49, Marco Colagrossi wrote:

I tried to upload the file once again. I tweaked it a bit, now my code is:

forest(pc, var, ci95m, ci95p, slab = authoryear, psize=1, subset=(pub==1),
xlim = c(-16, 6),
ilab = cbind(SIMdv, SIMiv),
ilab.xpos = c(-7.5, -5.5), cex = 0.75)
op - par(cex=.75, font=2)
   text(c(-7.5, -5.5), 54, c(DV, IV))
   text(-16,54, Author(s) and Year, pos=4)
   text(6,  54, Outcome [95% CI], pos=2)
par(op)

I managed to show both the Ilab argument and the text above. I still
have 3 issues:
- now the forest plot is too narrow - that is, pretty unreadable;


You need to re-read Wolfgang's advice again. The forest function tells 
you what values of xlim it used and you can then adjust them to suit. 
This will take a few attempts in my experience.



- I cannot still export it properly, as shown in the enclosed .png


It looked correctly exported to me. One comment, do you really need the 
complete citation of each study? Most of the forest plots I see as a 
reviewer just use the first author name and the year. This would 
potentially give you a lot more space.



- SIMdv, SIMiv are shown as number while on mine .csv are actually
text variable.

regarding the rma.mv package, I set it up this way (preliminarily)



I will leave this one to Wolfgang to answer.


multi - rma.mv(pc, var, random = ~ 1 | author, data=codebook)

I'm trying to compare the results with this equation, which is what -
I think, correct me if I'm wrong -  in econometrics we call
author-fixed effect, that is, model which are constant across
individuals (the random\fix notation is a bit tricky):

author_fix - rma(pc, var, mods = ~ I(author), data=codebook, method=ML)

What I was wondering if that the two equation above mentioned also
correct for heteroskedasticity which I need since my studies have
different sample and specifications.

Thanks for your help, your patience and your time, and many
compliments for the package, is guiding me through the use of R for
the first time - as you might have guessed.

Marco


On 24 August 2015 at 16:50, Viechtbauer Wolfgang (STAT)
wolfgang.viechtba...@maastrichtuniversity.nl wrote:

I cannot reproduce the issue with 'ilab' not being shown when using 'subset'. 
My guess is that the values for 'ilab.xpos' specified are actually outside of 
the plotting region. After you have drawn the forest plot, try:

par(usr)[1:2]

to see what the default limits actually are. Then use 'xlim' to adjust the 
limits to your taste. And then use appropriate values for 'ilab.xpos', so they 
are inside those limits.


Moreover, the graph is showed correctly only within the zoom in
Rstudio but if I save it it is showed as enclosed.


Nothing was enclosed (or it was stripped).


Moreover, how would you suggest to handle (graphically) the
multiple-cases-per-study thing? It's a 'good' way to average the cases
among different studies in the graphs?


Maybe add some space between groupings (i.e., studies). The example given here 
can provide some clues how one could go about this: 
http://www.metafor-project.org/doku.php/plots:forest_plot_with_subgroups But 
drawing a plot like this requires a lot of hand-tweaking.

Best,
Wolfgang

--
Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com


-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Marco
Colagrossi
Sent: Monday, August 24, 2015 16:04
To: r-help@r-project.org
Subject: [R] Metafor and forest(); not showing 'ilab' and text

Hello folks,

I have a couple of issues with the metafor package, specifically with
the forest graphs.
I am currently conducting a Meta-Analysis in economics throughout the
metafor package.

My meta-analysis has the specific of having different cases from
single studies, and this proven to be challenging especially when
trying to plot graphically the results I'm obtaining.

Here's the code:

forest(pc, var, ci95m, ci95p, slab = authoryear, psize=1,
subset=(pub==1),
ilab = cbind(ys, f_dim, SIMdv, SIMiv),
ilab.xpos = c(-9.5, -8, -6, -4.5), cex = 0.75)
par(font=2)
   text(c(-9.5,-8,-6,-4.5), 26, c(Years, Firm(s) Dimension, DV,
IV))
   text(-16,26, Author(s) and Year, pos=4)
   text(6,  26, Observed Outcome [95% CI], pos=2)
par(op)

'pc' is the 'effect size', 'var' the variance, 'ci95m  ci95p' the CI,
'pub' if the paper has been published or not. the pub subset was the
first idea I had in order to split my sample that otherwise would have
been to big. The issue with this solution is that forest() displays
only the slap argument and the forest with the confidence interval,
completely ignoring the lab argument and the text I'm trying to add.
Moreover, the graph

Re: [R] Metafor and forest(); not showing 'ilab' and text

2015-08-24 Thread Viechtbauer Wolfgang (STAT)
I cannot reproduce the issue with 'ilab' not being shown when using 'subset'. 
My guess is that the values for 'ilab.xpos' specified are actually outside of 
the plotting region. After you have drawn the forest plot, try:

par(usr)[1:2]

to see what the default limits actually are. Then use 'xlim' to adjust the 
limits to your taste. And then use appropriate values for 'ilab.xpos', so they 
are inside those limits.

 Moreover, the graph is showed correctly only within the zoom in
 Rstudio but if I save it it is showed as enclosed.

Nothing was enclosed (or it was stripped).

 Moreover, how would you suggest to handle (graphically) the
 multiple-cases-per-study thing? It's a 'good' way to average the cases
 among different studies in the graphs?

Maybe add some space between groupings (i.e., studies). The example given here 
can provide some clues how one could go about this: 
http://www.metafor-project.org/doku.php/plots:forest_plot_with_subgroups But 
drawing a plot like this requires a lot of hand-tweaking.

Best,
Wolfgang

-- 
Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com

 -Original Message-
 From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Marco
 Colagrossi
 Sent: Monday, August 24, 2015 16:04
 To: r-help@r-project.org
 Subject: [R] Metafor and forest(); not showing 'ilab' and text
 
 Hello folks,
 
 I have a couple of issues with the metafor package, specifically with
 the forest graphs.
 I am currently conducting a Meta-Analysis in economics throughout the
 metafor package.
 
 My meta-analysis has the specific of having different cases from
 single studies, and this proven to be challenging especially when
 trying to plot graphically the results I'm obtaining.
 
 Here's the code:
 
 forest(pc, var, ci95m, ci95p, slab = authoryear, psize=1,
 subset=(pub==1),
ilab = cbind(ys, f_dim, SIMdv, SIMiv),
ilab.xpos = c(-9.5, -8, -6, -4.5), cex = 0.75)
 par(font=2)
   text(c(-9.5,-8,-6,-4.5), 26, c(Years, Firm(s) Dimension, DV,
 IV))
   text(-16,26, Author(s) and Year, pos=4)
   text(6,  26, Observed Outcome [95% CI], pos=2)
 par(op)
 
 'pc' is the 'effect size', 'var' the variance, 'ci95m  ci95p' the CI,
 'pub' if the paper has been published or not. the pub subset was the
 first idea I had in order to split my sample that otherwise would have
 been to big. The issue with this solution is that forest() displays
 only the slap argument and the forest with the confidence interval,
 completely ignoring the lab argument and the text I'm trying to add.
 Moreover, the graph is showed correctly only within the zoom in
 Rstudio but if I save it it is showed as enclosed.
 
 What I'm doing wrong? I tried both to look at the package
 documentation and online but I can't figure it out.
 
 Moreover, how would you suggest to handle (graphically) the
 multiple-cases-per-study thing? It's a 'good' way to average the cases
 among different studies in the graphs?
 In my meta-analysis I'm using a multilevel model as shown in
 Gelman-Hill but graphically (and in tables) I'm struggling.
 
 Thanks for your help and patience
 
 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] Metafor and forest(); not showing 'ilab' and text

2015-08-24 Thread Marco Colagrossi
Hello folks,

I have a couple of issues with the metafor package, specifically with
the forest graphs.
I am currently conducting a Meta-Analysis in economics throughout the
metafor package.

My meta-analysis has the specific of having different cases from
single studies, and this proven to be challenging especially when
trying to plot graphically the results I'm obtaining.

Here's the code:

forest(pc, var, ci95m, ci95p, slab = authoryear, psize=1, subset=(pub==1),
   ilab = cbind(ys, f_dim, SIMdv, SIMiv),
   ilab.xpos = c(-9.5, -8, -6, -4.5), cex = 0.75)
par(font=2)
  text(c(-9.5,-8,-6,-4.5), 26, c(Years, Firm(s) Dimension, DV, IV))
  text(-16,26, Author(s) and Year, pos=4)
  text(6,  26, Observed Outcome [95% CI], pos=2)
par(op)

'pc' is the 'effect size', 'var' the variance, 'ci95m  ci95p' the CI,
'pub' if the paper has been published or not. the pub subset was the
first idea I had in order to split my sample that otherwise would have
been to big. The issue with this solution is that forest() displays
only the slap argument and the forest with the confidence interval,
completely ignoring the lab argument and the text I'm trying to add.
Moreover, the graph is showed correctly only within the zoom in
Rstudio but if I save it it is showed as enclosed.

What I'm doing wrong? I tried both to look at the package
documentation and online but I can't figure it out.

Moreover, how would you suggest to handle (graphically) the
multiple-cases-per-study thing? It's a 'good' way to average the cases
among different studies in the graphs?
In my meta-analysis I'm using a multilevel model as shown in
Gelman-Hill but graphically (and in tables) I'm struggling.

Thanks for your help and patience

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Metafor and forest(); not showing 'ilab' and text

2015-08-24 Thread Michael Dewey

Dear Marco

Comments inline

On 24/08/2015 15:03, Marco Colagrossi wrote:

Hello folks,

I have a couple of issues with the metafor package, specifically with
the forest graphs.
I am currently conducting a Meta-Analysis in economics throughout the
metafor package.

My meta-analysis has the specific of having different cases from
single studies, and this proven to be challenging especially when
trying to plot graphically the results I'm obtaining.

Here's the code:

forest(pc, var, ci95m, ci95p, slab = authoryear, psize=1, subset=(pub==1),
ilab = cbind(ys, f_dim, SIMdv, SIMiv),
ilab.xpos = c(-9.5, -8, -6, -4.5), cex = 0.75)


At this point I think you meant to close the call to forest with another 
) as the subsequent calls to text are further commands and not internal 
to the call of forest.



par(font=2)
   text(c(-9.5,-8,-6,-4.5), 26, c(Years, Firm(s) Dimension, DV, IV))
   text(-16,26, Author(s) and Year, pos=4)
   text(6,  26, Observed Outcome [95% CI], pos=2)
par(op)


For that to have worked you probably meant to go
op - par() somewhere earlier



'pc' is the 'effect size', 'var' the variance, 'ci95m  ci95p' the CI,
'pub' if the paper has been published or not. the pub subset was the
first idea I had in order to split my sample that otherwise would have
been to big. The issue with this solution is that forest() displays
only the slap argument and the forest with the confidence interval,
completely ignoring the lab argument and the text I'm trying to add.
Moreover, the graph is showed correctly only within the zoom in
Rstudio but if I save it it is showed as enclosed.



Sorry, do not use Rstudio myself


What I'm doing wrong? I tried both to look at the package
documentation and online but I can't figure it out.

Moreover, how would you suggest to handle (graphically) the
multiple-cases-per-study thing? It's a 'good' way to average the cases
among different studies in the graphs?


Are you looking for rma.mv perhaps?


In my meta-analysis I'm using a multilevel model as shown in
Gelman-Hill but graphically (and in tables) I'm struggling.

Thanks for your help and patience

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.



--
Michael
http://www.dewey.myzen.co.uk/home.html

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Metafor and forest(); not showing 'ilab' and text

2015-08-24 Thread Marco Colagrossi
I tried to upload the file once again. I tweaked it a bit, now my code is:

forest(pc, var, ci95m, ci95p, slab = authoryear, psize=1, subset=(pub==1),
   xlim = c(-16, 6),
   ilab = cbind(SIMdv, SIMiv),
   ilab.xpos = c(-7.5, -5.5), cex = 0.75)
op - par(cex=.75, font=2)
  text(c(-7.5, -5.5), 54, c(DV, IV))
  text(-16,54, Author(s) and Year, pos=4)
  text(6,  54, Outcome [95% CI], pos=2)
par(op)

I managed to show both the Ilab argument and the text above. I still
have 3 issues:
- now the forest plot is too narrow - that is, pretty unreadable;
- I cannot still export it properly, as shown in the enclosed .png
- SIMdv, SIMiv are shown as number while on mine .csv are actually
text variable.

regarding the rma.mv package, I set it up this way (preliminarily)

multi - rma.mv(pc, var, random = ~ 1 | author, data=codebook)

I'm trying to compare the results with this equation, which is what -
I think, correct me if I'm wrong -  in econometrics we call
author-fixed effect, that is, model which are constant across
individuals (the random\fix notation is a bit tricky):

author_fix - rma(pc, var, mods = ~ I(author), data=codebook, method=ML)

What I was wondering if that the two equation above mentioned also
correct for heteroskedasticity which I need since my studies have
different sample and specifications.

Thanks for your help, your patience and your time, and many
compliments for the package, is guiding me through the use of R for
the first time - as you might have guessed.

Marco


On 24 August 2015 at 16:50, Viechtbauer Wolfgang (STAT)
wolfgang.viechtba...@maastrichtuniversity.nl wrote:
 I cannot reproduce the issue with 'ilab' not being shown when using 'subset'. 
 My guess is that the values for 'ilab.xpos' specified are actually outside of 
 the plotting region. After you have drawn the forest plot, try:

 par(usr)[1:2]

 to see what the default limits actually are. Then use 'xlim' to adjust the 
 limits to your taste. And then use appropriate values for 'ilab.xpos', so 
 they are inside those limits.

 Moreover, the graph is showed correctly only within the zoom in
 Rstudio but if I save it it is showed as enclosed.

 Nothing was enclosed (or it was stripped).

 Moreover, how would you suggest to handle (graphically) the
 multiple-cases-per-study thing? It's a 'good' way to average the cases
 among different studies in the graphs?

 Maybe add some space between groupings (i.e., studies). The example given 
 here can provide some clues how one could go about this: 
 http://www.metafor-project.org/doku.php/plots:forest_plot_with_subgroups But 
 drawing a plot like this requires a lot of hand-tweaking.

 Best,
 Wolfgang

 --
 Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
 Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
 Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com

 -Original Message-
 From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Marco
 Colagrossi
 Sent: Monday, August 24, 2015 16:04
 To: r-help@r-project.org
 Subject: [R] Metafor and forest(); not showing 'ilab' and text

 Hello folks,

 I have a couple of issues with the metafor package, specifically with
 the forest graphs.
 I am currently conducting a Meta-Analysis in economics throughout the
 metafor package.

 My meta-analysis has the specific of having different cases from
 single studies, and this proven to be challenging especially when
 trying to plot graphically the results I'm obtaining.

 Here's the code:

 forest(pc, var, ci95m, ci95p, slab = authoryear, psize=1,
 subset=(pub==1),
ilab = cbind(ys, f_dim, SIMdv, SIMiv),
ilab.xpos = c(-9.5, -8, -6, -4.5), cex = 0.75)
 par(font=2)
   text(c(-9.5,-8,-6,-4.5), 26, c(Years, Firm(s) Dimension, DV,
 IV))
   text(-16,26, Author(s) and Year, pos=4)
   text(6,  26, Observed Outcome [95% CI], pos=2)
 par(op)

 'pc' is the 'effect size', 'var' the variance, 'ci95m  ci95p' the CI,
 'pub' if the paper has been published or not. the pub subset was the
 first idea I had in order to split my sample that otherwise would have
 been to big. The issue with this solution is that forest() displays
 only the slap argument and the forest with the confidence interval,
 completely ignoring the lab argument and the text I'm trying to add.
 Moreover, the graph is showed correctly only within the zoom in
 Rstudio but if I save it it is showed as enclosed.

 What I'm doing wrong? I tried both to look at the package
 documentation and online but I can't figure it out.

 Moreover, how would you suggest to handle (graphically) the
 multiple-cases-per-study thing? It's a 'good' way to average the cases
 among different studies in the graphs?
 In my meta-analysis I'm using a multilevel model as shown in
 Gelman-Hill but graphically (and in tables) I'm struggling.

 Thanks for your help and patience

Re: [R] Metafor - rma.mv function - variance components

2015-04-21 Thread Carlijn Wibbelink
Thank you for your reaction, it worked.
However, I'm wondering if this is the right way to test whether there is 
significant variation on one of the two levels. The results of the anova tests 
do not correspond to the results of the Z-test in metaSEM. (In metaSEM only one 
of the variances is significant, but when I use the anova test in metafor, both 
variances are significant). But maybe I made a mistake. This is my syntax:
model2 - rma.mv(y, v, random = list(~ 1 | y, ~ 1 | ID), data=dat)
model3 - rma.mv(y, v, random = list(~ 1 | y, ~ 1 | ID), sigma2=c(NA,0), 
data=dat)
model4 - rma.mv(y, v, random = list(~ 1 | y, ~ 1 | ID), sigma2=c(0,NA), 
data=dat)
anova(model2,model3)
anova(model2,model4)

Is it possible to receive the standard errors of the variances in metafor (and 
do a Z-test)?


 To: wibbelt...@hotmail.com; r-help@r-project.org
 Subject: Re: [R] Metafor - rma.mv function - variance components
 From: li...@dewey.myzen.co.uk
 Date: Mon, 20 Apr 2015 20:24:48 +
 
 Carlijn Wibbelink wibbelt...@hotmail.com wrote :
 
 Dear Carlijn
 I think that if you set sigma2 to a vector of length 2 it will be possible.
 
  Hi all,
  
  I have a question about metafor and the rma.mv function. I have fitted a
  multivariate model (effect sizes are nested within studies) and I've found 
  two
  variances: 
  
  Variance Components: 
estimsqrt nlvls  fixed  factor
  sigma^2.1  0.0257  0.1602 72 no   y
  sigma^2.2  0.0694  0.2635 10 no  ID 
  
  I want to test whether there is significant variantion between the effect 
  sizes
  within studies (sigma^2.1: 0.0257) and/or between studies (sigma^2.2: 
  0.0694).
  In metaSEM you can fix for example the variance within studies (sigma^2.1) 
  to
  zero to test whether there is a significant difference in fit between the 
  models
  (and if so, then there is significant heterogeneity between the effect sizes
  within studies). I was wondering if this is also possible in metafor. If I 
  fix
  sigma2 to zero, then both variances are fixed to zero. However, I want to 
  fix
  only one variance to zero. 
  I hope that someone can help me. Thank you in advance!

  [[alternative HTML version deleted]]
  
  __
  R-help@r-project.org
  mailing list -- To UNSUBSCRIBE and more, see
  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.
 
 
 
 
 
  
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Metafor - rma.mv function - variance components

2015-04-21 Thread Viechtbauer Wolfgang (STAT)
This is correct (for getting likelihood ratio tests). Manually setting a 
component to 0 is also the same as just leaving out the corresponding random 
effect. So, you could also do:

model2 - rma.mv(y, v, random = list(~ 1 | y, ~ 1 | ID), data=dat)
model3 - rma.mv(y, v, random = ~ 1 | y, data=dat)
model4 - rma.mv(y, v, random = ~ 1 | ID, data=dat)
anova(model2,model3)
anova(model2,model4)

That should give you identical results.

At the moment, rma.mv() does not compute SEs for the variance components. It 
may at some point in the future, but it is unclear what one would do with those 
SEs. Wald-type tests (z-tests) should generally be avoided when testing 
variance components.

Best,
Wolfgang

--
Wolfgang Viechtbauer, Ph.D., Statistician
Department of Psychiatry and Neuropsychology
School for Mental Health and Neuroscience
Faculty of Health, Medicine, and Life Sciences
Maastricht University, P.O. Box 616 (VIJV1)
6200 MD Maastricht, The Netherlands
+31 (43) 388-4170 | http://www.wvbauer.com

 -Original Message-
 From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Carlijn
 Wibbelink
 Sent: Tuesday, April 21, 2015 10:43
 To: li...@dewey.myzen.co.uk; r-help@r-project.org
 Subject: Re: [R] Metafor - rma.mv function - variance components
 
 Thank you for your reaction, it worked.
 However, I'm wondering if this is the right way to test whether there is
 significant variation on one of the two levels. The results of the anova
 tests do not correspond to the results of the Z-test in metaSEM. (In
 metaSEM only one of the variances is significant, but when I use the
 anova test in metafor, both variances are significant). But maybe I made
 a mistake. This is my syntax:
 model2 - rma.mv(y, v, random = list(~ 1 | y, ~ 1 | ID), data=dat)
 model3 - rma.mv(y, v, random = list(~ 1 | y, ~ 1 | ID), sigma2=c(NA,0),
 data=dat)
 model4 - rma.mv(y, v, random = list(~ 1 | y, ~ 1 | ID), sigma2=c(0,NA),
 data=dat)
 anova(model2,model3)
 anova(model2,model4)
 
 Is it possible to receive the standard errors of the variances in metafor
 (and do a Z-test)?
 
  To: wibbelt...@hotmail.com; r-help@r-project.org
  Subject: Re: [R] Metafor - rma.mv function - variance components
  From: li...@dewey.myzen.co.uk
  Date: Mon, 20 Apr 2015 20:24:48 +
 
  Carlijn Wibbelink wibbelt...@hotmail.com wrote :
 
  Dear Carlijn
  I think that if you set sigma2 to a vector of length 2 it will be
 possible.
 
   Hi all,
  
   I have a question about metafor and the rma.mv function. I have
 fitted a
   multivariate model (effect sizes are nested within studies) and I've
 found two
   variances:
  
   Variance Components:
 estimsqrt nlvls  fixed  factor
   sigma^2.1  0.0257  0.1602 72 no   y
   sigma^2.2  0.0694  0.2635 10 no  ID
  
   I want to test whether there is significant variantion between the
 effect sizes
   within studies (sigma^2.1: 0.0257) and/or between studies (sigma^2.2:
 0.0694).
   In metaSEM you can fix for example the variance within studies
 (sigma^2.1) to
   zero to test whether there is a significant difference in fit between
 the models
   (and if so, then there is significant heterogeneity between the
 effect sizes
   within studies). I was wondering if this is also possible in metafor.
 If I fix
   sigma2 to zero, then both variances are fixed to zero. However, I
 want to fix
   only one variance to zero.
   I hope that someone can help me. Thank you in advance!
  
 [[alternative HTML version deleted]]
  
   __
   R-help@r-project.org
   mailing list -- To UNSUBSCRIBE and more, see
   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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Metafor - rma.mv function - variance components

2015-04-21 Thread Michael Dewey

Dear Carlijn

You might shed some light on what is going on by using
profile.rma.mv

Michael

On 21/04/2015 09:42, Carlijn Wibbelink wrote:

Thank you for your reaction, it worked.
However, I'm wondering if this is the right way to test whether there is
significant variation on one of the two levels. The results of the anova
tests do not correspond to the results of the Z-test in metaSEM. (In
metaSEM only one of the variances is significant, but when I use the
anova test in metafor, both variances are significant). But maybe I made
a mistake. This is my syntax:
model2 - rma.mv(y, v, random = list(~ 1 | y, ~ 1 | ID), data=dat)
model3 - rma.mv(y, v, random = list(~ 1 | y, ~ 1 | ID), sigma2=c(NA,0),
data=dat)
model4 - rma.mv(y, v, random = list(~ 1 | y, ~ 1 | ID), sigma2=c(0,NA),
data=dat)
anova(model2,model3)
anova(model2,model4)

Is it possible to receive the standard errors of the variances in
metafor (and do a Z-test)?


  To: wibbelt...@hotmail.com; r-help@r-project.org
  Subject: Re: [R] Metafor - rma.mv function - variance components
  From: li...@dewey.myzen.co.uk
  Date: Mon, 20 Apr 2015 20:24:48 +
 
  Carlijn Wibbelink wibbelt...@hotmail.com wrote :
 
  Dear Carlijn
  I think that if you set sigma2 to a vector of length 2 it will be
possible.
 
   Hi all,
  
   I have a question about metafor and the rma.mv function. I have
fitted a
   multivariate model (effect sizes are nested within studies) and
I've found two
   variances:
  
   Variance Components:
   estim sqrt nlvls fixed factor
   sigma^2.1 0.0257 0.1602 72 no y
   sigma^2.2 0.0694 0.2635 10 no ID
  
   I want to test whether there is significant variantion between the
effect sizes
   within studies (sigma^2.1: 0.0257) and/or between studies
(sigma^2.2: 0.0694).
   In metaSEM you can fix for example the variance within studies
(sigma^2.1) to
   zero to test whether there is a significant difference in fit
between the models
   (and if so, then there is significant heterogeneity between the
effect sizes
   within studies). I was wondering if this is also possible in
metafor. If I fix
   sigma2 to zero, then both variances are fixed to zero. However, I
want to fix
   only one variance to zero.
   I hope that someone can help me. Thank you in advance!
  
   [[alternative HTML version deleted]]
  
   __
   R-help@r-project.org
   mailing list -- To UNSUBSCRIBE and more, see
   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.
 
 
 
 
 


--
Michael
http://www.dewey.myzen.co.uk/home.html

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Metafor - rma.mv function - variance components

2015-04-20 Thread Lists
Carlijn Wibbelink wibbelt...@hotmail.com wrote :

Dear Carlijn
I think that if you set sigma2 to a vector of length 2 it will be possible.

 Hi all,
 
 I have a question about metafor and the rma.mv function. I have fitted a
 multivariate model (effect sizes are nested within studies) and I've found two
 variances: 
 
 Variance Components: 
   estimsqrt nlvls  fixed  factor
 sigma^2.1  0.0257  0.1602 72 no   y
 sigma^2.2  0.0694  0.2635 10 no  ID 
 
 I want to test whether there is significant variantion between the effect 
 sizes
 within studies (sigma^2.1: 0.0257) and/or between studies (sigma^2.2: 0.0694).
 In metaSEM you can fix for example the variance within studies (sigma^2.1) to
 zero to test whether there is a significant difference in fit between the 
 models
 (and if so, then there is significant heterogeneity between the effect sizes
 within studies). I was wondering if this is also possible in metafor. If I fix
 sigma2 to zero, then both variances are fixed to zero. However, I want to fix
 only one variance to zero. 
 I hope that someone can help me. Thank you in advance!
 
   [[alternative HTML version deleted]]
 
 __
 R-help@r-project.org
 mailing list -- To UNSUBSCRIBE and more, see
 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] Metafor - rma.mv function - variance components

2015-04-20 Thread Carlijn Wibbelink
Hi all,

I have a question about metafor and the rma.mv function. I have fitted a 
multivariate model (effect sizes are nested within studies) and I've found two 
variances: 

Variance Components: 
  estimsqrt nlvls  fixed  factor
sigma^2.1  0.0257  0.1602 72 no   y
sigma^2.2  0.0694  0.2635 10 no  ID 

I want to test whether there is significant variantion between the effect sizes 
within studies (sigma^2.1: 0.0257) and/or between studies (sigma^2.2: 0.0694). 
In metaSEM you can fix for example the variance within studies (sigma^2.1) to 
zero to test whether there is a significant difference in fit between the 
models (and if so, then there is significant heterogeneity between the effect 
sizes within studies). I was wondering if this is also possible in metafor. If 
I fix sigma2 to zero, then both variances are fixed to zero. However, I want to 
fix only one variance to zero. 
I hope that someone can help me. Thank you in advance!
  
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] 'metafor' - standardized mean difference in pre-post design studies

2015-04-14 Thread Viechtbauer Wolfgang (STAT)
 Hi, I have a quesite on meta-analysis with 'metafor'.
 I would like to calculate the standardized mean difference (SMD), as
 Hedges' g, in pre-post design studies.
 I have data on baseline (sample size, mean and SD in both the
 experimental
 and the control group) and at end of treatment (same as before).
 The 'metafor' site report a calculation based on Morris (2008).
 However, I would like to calculate the SMD as in Comprehensive
 Meta-analysis according to Borenstein:
 
 d = (mean.pre - mean.post) / SD_within
 
 SD_within = SD.diff / square root (2(1-r)

Note that this assumes that the SDs are the same at baseline and at the end of 
the treatment. Also, it is not how d values for pre-post designs are typically 
computed. There are several articles that describe various approaches, in 
particular:

Becker, B. J. (1988). Synthesizing standardized mean-change measures. British 
Journal of Mathematical and Statistical Psychology, 41(2), 257-278.

Gibbons, R. D., Hedeker, D. R.,  Davis, J. M. (1993). Estimation of effect 
size from a series of experiments involving paired comparisons. Journal of 
Educational Statistics, 18(3), 271-279.

Morris, S. B. (2000). Distribution of the standardized mean change effect size 
for meta-analysis on repeated measures. British Journal of Mathematical and 
Statistical Psychology, 53(1), 17-29.

Morris, S. B.,  DeShon, R. P. (2002). Combining effect size estimates in 
meta-analysis with repeated measures and independent-groups designs. 
Psychological Methods, 7(1), 105-125.

Morris, S. B. (2008). Estimating effect sizes from pretest-posttest-control 
group designs. Organizational Research Methods, 11(2), 364-386.

The two approaches that have been most thoroughly studied and described are:

d = (mean.pre - mean.post) / SD.diff

(standardization by the change score SD) and

d = (mean.pre - mean.post) / SD.pre

(standardization by the pre-test SD; one could also use the post-test SD).

The method described in the book is a bit of a juxtaposition, where SD.diff is 
'corrected' by 1/sqrt(2*(1-r)), which is identical to SD.pre (or SD.post) when 
SD.pre = SD.post. But that's never exactly the case. Plus I am not aware of any 
proper derivations of the large-sample distribution of d computed in this 
manner.

 r = correlation between pairs of observation (often it is not reported,
 and suggestion is to use r = 0.70)

Suggested where? I hope this is not a general if you don't know the 
correlation, just use .70 suggestion, because that would be nonsense. If you 
don't know r for the sample, then you could try to make a reasonable guess that 
is informed by the characteristic or attribute that is being measured (some 
things are much more stable than other things) and the timelag between baseline 
and the follow-up measurement. Also, if some treatment happens between baseline 
and follow-up -- and some people are more likely to respond to the treatment 
than others -- then this is likely to reduce the correlation to some extent, 
depending on how much variability there is in treatment responses. These are at 
least some of the considerations that should go into making a proper guess 
about r.

 The variance of d (Vd) is calculated as (1/n + d^2/2n)2(1-r), where n =
 number of pairs

As mentioned above, I am not aware of any derivation of that equation. One can 
show that 2(1-r)/n + d^2/2n is an estimate of the asymptotic sampling variance 
of d when d is computed as (mean.pre - mean.post) / SD.pre (or with SD.post). 
So, when d is computed in the manner above, it is a bit like (mean.pre - 
mean.post) / SD.pre -- except for the way that SD.pre is actually estimated. 
So, if anything, the equation should look more like the one above and not the 
one in the book. I have actually communicated with Michael and Larry (Hedges) 
about this and Michael indicated that changes may need to be made to CMA.

 To derive Hedges' g from d, the correction 'J' is used:
 
 J = 1 - (3/4df - 1), where df = degrees of freedom, which in two
 independent groups is n1+n2-2
 
 Essentially, J = 1 - (3/4*((n1+n2)-2) - 1)
 
 Ultimately, g = J x d, and variance of g (Vg) = J^2 x Vd
 
 I had some hint by Wolfgang Viechtbauer, but I'm stucked on here
 (essentially, because my poor programming abilities)
 I was stuck on applying the Viechtbauer's hint to my dataset.
 Probably I'm doing something wrong. However, what I get it is not what I
 found with Comprehensive Meta-Analysis.
 In CMA I've found g = -0.49 (95%CI: -0.64 to -0.33).

You won't get the same thing, as CMA does what is described in the book, but 
that's not what metafor does (due to the reasons described above).

 Moreover, I do not know how to apply the J correction for calculating the
 Hedges'g.
 My request is: can anyone check the codes?
 Can anyone help me in adding the J correction?
 What should I multiply for J?
 Should I use the final yi and vi as measures of d and Variance of d?

Why don't you just use what escalc() gives you?

 Thank you in 

Re: [R] metafor - Cochrane on change score in pre-post design

2015-04-14 Thread Michael Dewey

Comment below

On 13/04/2015 20:46, Antonello Preti wrote:

Hi, this is another quesite related to the use of 'metafor' for calculation
of standardized mean change in pre-post design studies.
Essentially, my aim is to compare different method to arrive at the same
conclusion: Does the treatment work?

The Cochrane manual advise not to calculate change score:

9.4.5.2  Meta-analysis of change scores

In some circumstances an analysis based on changes from baseline will be
more efficient and powerful than comparison of final values,
as it removes a component of between-person variability from the analysis.
However, calculation of a change score requires measurement of the outcome
twice
and in practice may be less efficient for outcomes which are unstable or
difficult to measure precisely,
where the measurement error may be larger than true between-person baseline
variability.
Change-from-baseline outcomes may also be preferred if they have a less
skewed distribution than final measurement outcomes.
Although sometimes used as a device to ‘correct’ for unlucky randomization,
this practice is not recommended.

The preferred statistical approach to accounting for baseline measurements
of the outcome variable
is to include the baseline outcome measurements as a covariate in a
regression model or analysis of covariance (ANCOVA).



As I read Cochrane this is a comment about which data you should extract 
from the primary studies if you have a choice. It is not a 
recommendation to you the meta-analyst about how you subsequently 
conduct the meta-analysis of the extracted data.



My question is: how do include both baseline (experimental and control
group)  in the analysis as a covariate in 'metafor'?
So, far, this is what I did.
I kinly request some help tp add the baseline as covariate to comply with
the Cochrane suggestion-
How can I add the baseline mean in both groups?
Should I consider baseline standard deviation, and if yes, how?
Should I take into account dropouts? I mean, in some sample at baseline n =
30 and 35 and at end of treatment n was 28 and 29...



Thank you in advance,
Antonello Preti




This is my dataset (with imputed r = 0.70 for pre-post correlation, put in
the 'ri' variable):

# the data

dat - structure(list(study = structure(c(11L, 8L, 7L, 12L, 13L, 4L,
5L, 1L, 10L, 3L, 6L, 9L, 2L), .Label = c(Study A, 2012,
Study B, 2013, Study C, 2013, Study D, 2010,
Study E, 2012, Study F, 2013, Study G, 2006,
Study H, 2005, Study I, 2013, Study L, 2012,
Study M, 2003, Study N, 2007, Study P, 2007
), class = factor), c_pre_mean = c(4.9, 15.18, 19.01, 5.1,
16.5, 27.35, 18.1, 2.4, 14.23, 0.08, 21.26, 21.5, 21.73), c_pre_sd = c(2.6,
2.21, 7.1, 1.5, 7.2, 13.92, 5.4, 0.13, 4.89, 0.94, 7.65, 5.22,
8.43), c_post_mean = c(6.1, 13.98, 18.5, 4.53, 15.9, 23, 16.9,
2.2, 16.58, -0.02, 16, 16.84, 23.54), c_post_sd = c(2.06, 3.24,
7, 2.06, 6.8, 12.06, 3.8, 0.13, 6.35, 0.88, 4.69, 4.64, 6.74),
 c_sample = c(14, 13, 19, 15, 34, 20, 24, 35, 31, 26, 49,
 21, 22), e_pre_mean = c(4.6, 13.81, 19.9, 5.3, 18.7, 22.71,
 19.2, 2.7, 15.97, -0.22, 20.9, 20.43, 21.94), e_pre_sd = c(2.1,
 6.64, 8.1, 2.9, 7.3, 7.82, 4.1, 0.13, 6.73, 0.93, 5.18, 4.87,
 7.02), e_post_mean = c(4.64, 15.86, 18.1, 4.33, 17.2, 24.89,
 17.6, 2.8, 13.6, 0.06, 17.41, 16.05, 19.29), e_post_sd = c(2.34,
 7.76, 7.8, 2.26, 7.4, 11.89, 3.7, 0.13, 5.79, 1.12, 5.16,
 4.17, 6.58), e_sample = c(14, 18, 16, 16, 33, 28, 29, 36,
 38, 27, 43, 25, 17), ri = c(.70,
.70,.70,.70,.70,.70,.70,.70,.70,.70,.70,.70,.70)), .Names = c(study,
c_pre_mean, c_pre_sd,
c_post_mean, c_post_sd, c_sample, e_pre_mean, e_pre_sd,
e_post_mean, e_post_sd, e_sample, ri), class = data.frame,
row.names = c(NA,
-13L))


### check the data

dim(dat)
head(dat)
str(dat)

attach(dat)  yes, I know, do'nt do this

# call the library

library(metafor)


# Computing Standardized Mean Difference (Hedges' g) for Each Group
(experimental and control) at post treatment
# use SMD for the standardized mean difference using raw score
standardization

datT - escalc(measure=SMD, m1i=e_post_mean, sd1i=e_post_sd,
n1i=e_sample, m2i=c_post_mean, sd2i=c_post_sd, n2i=c_sample, vtype=UB,
data=dat, append=TRUE)


# Extract the effect size ( Standardized Mean Difference (Hedges' g)) and
its variance

yi - datT$yi
vi - datT$vi



###
#
# fixed-effects model
#
###

model.FE - rma(yi, vi, method=FE, digits=2)

summary(model.FE)

# plot globale

plot(model.FE, slab=paste(study))

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.



--
Michael
http://www.dewey.myzen.co.uk/home.html


[R] 'metafor' - standardized mean difference in pre-post design studies

2015-04-13 Thread Antonello Preti
Hi, I have a quesite on meta-analysis with 'metafor'.
I would like to calculate the standardized mean difference (SMD), as
Hedges' g, in pre-post design studies.
I have data on baseline (sample size, mean and SD in both the experimental
and the control group) and at end of treatment (same as before).
The 'metafor' site report a calculation based on Morris (2008).
However, I would like to calculate the SMD as in Comprehensive
Meta-analysis according to Borenstein:

d = (mean.pre - mean.post) / SD_within

SD_within = SD.diff / square root (2(1-r)

r = correlation between pairs of observation (often it is not reported, and
suggestion is to use r = 0.70)

The variance of d (Vd) is calculated as (1/n + d^2/2n)2(1-r), where n =
number of pairs

To derive Hedges' g from d, the correction 'J' is used:

J = 1 - (3/4df - 1), where df = degrees of freedom, which in two
independent groups is n1+n2-2

Essentially, J = 1 - (3/4*((n1+n2)-2) - 1)

Ultimately, g = J x d, and variance of g (Vg) = J^2 x Vd


I had some hint by Wolfgang Viechtbauer, but I'm stucked on here
(essentially, because my poor programming abilities)
I was stuck on applying the Viechtbauer's hint to my dataset.
Probably I'm doing something wrong. However, what I get it is not what I
found with Comprehensive Meta-Analysis.
In CMA I've found g = -0.49 (95%CI: -0.64 to -0.33).

Moreover, I do not know how to apply the J correction for calculating the
Hedges'g.
My request is: can anyone check the codes?
Can anyone help me in adding the J correction?
What should I multiply for J?
Should I use the final yi and vi as measures of d and Variance of d?


Thank you in advance,
Antonello Preti


This is my dataset (with imputed r = 0.70, put in the 'ri' variable):

# the data

dat - structure(list(study = structure(c(11L, 8L, 7L, 12L, 13L, 4L,
5L, 1L, 10L, 3L, 6L, 9L, 2L), .Label = c(Study A, 2012,
Study B, 2013, Study C, 2013, Study D, 2010,
Study E, 2012, Study F, 2013, Study G, 2006,
Study H, 2005, Study I, 2013, Study L, 2012,
Study M, 2003, Study N, 2007, Study P, 2007
), class = factor), c_pre_mean = c(4.9, 15.18, 19.01, 5.1,
16.5, 27.35, 18.1, 2.4, 14.23, 0.08, 21.26, 21.5, 21.73), c_pre_sd = c(2.6,
2.21, 7.1, 1.5, 7.2, 13.92, 5.4, 0.13, 4.89, 0.94, 7.65, 5.22,
8.43), c_post_mean = c(6.1, 13.98, 18.5, 4.53, 15.9, 23, 16.9,
2.2, 16.58, -0.02, 16, 16.84, 23.54), c_post_sd = c(2.06, 3.24,
7, 2.06, 6.8, 12.06, 3.8, 0.13, 6.35, 0.88, 4.69, 4.64, 6.74),
c_sample = c(14, 13, 19, 15, 34, 20, 24, 35, 31, 26, 49,
21, 22), e_pre_mean = c(4.6, 13.81, 19.9, 5.3, 18.7, 22.71,
19.2, 2.7, 15.97, -0.22, 20.9, 20.43, 21.94), e_pre_sd = c(2.1,
6.64, 8.1, 2.9, 7.3, 7.82, 4.1, 0.13, 6.73, 0.93, 5.18, 4.87,
7.02), e_post_mean = c(4.64, 15.86, 18.1, 4.33, 17.2, 24.89,
17.6, 2.8, 13.6, 0.06, 17.41, 16.05, 19.29), e_post_sd = c(2.34,
7.76, 7.8, 2.26, 7.4, 11.89, 3.7, 0.13, 5.79, 1.12, 5.16,
4.17, 6.58), e_sample = c(14, 18, 16, 16, 33, 28, 29, 36,
38, 27, 43, 25, 17), ri = c(.70,
.70,.70,.70,.70,.70,.70,.70,.70,.70,.70,.70,.70)), .Names = c(study,
c_pre_mean, c_pre_sd,
c_post_mean, c_post_sd, c_sample, e_pre_mean, e_pre_sd,
e_post_mean, e_post_sd, e_sample, ri), class = data.frame,
row.names = c(NA,
-13L))


### check the data

dim(dat)
head(dat)
str(dat)

### to make easy the operations (I know it should'nt be done)

attach(dat)


### call the library

library('metafor')

### The hint by Viechtbauer is that CMA computes the d value for a pre-post
design in a slightly different way than metafor. CMA computes:

### d = (m_1 - m_2) / (SD_diff / sqrt(2*(1-r)))

### To do this, I should calculate something like this (first the control
group):

sd1i= c_pre_sd
sd2i = c_post_sd
ni = c_sample

dat$sdi_c - with(dat, sqrt((sd1i^2 + sd2i^2 -
2*ri*sd1i*sd2i))/sqrt(2*(1-ri)))

### Then apply the usual calculation with escalc:

datC - escalc(measure=SMCR, m1i=c_pre_mean, m2i=c_post_mean, sd1i=sdi_c,
ni=ni, ri=ri, data=dat)
summary(datC)


 The same on the experimental group

sd1i= e_pre_sd
sd2i = e_post_sd
ni = e_sample


dat$sdi_e - with(dat, sqrt((sd1i^2 + sd2i^2 -
2*ri*sd1i*sd2i))/sqrt(2*(1-ri)))

datE - escalc(measure=SMCR, m1i=e_pre_mean, m2i=e_post_mean, sd1i=sdi_e,
ni=ni, ri=ri, data=dat)
summary(datE)


 Computing the Difference in the Standardized Mean Change

datFin - data.frame(yi = datE$yi - datC$yi, vi = datE$vi + datC$vi)
round(datFin, 2)



###
#
# fixed-effects model
#
###

model.FE - rma(yi, vi, data=datFin, method=FE, digits=2)

summary(model.FE)

# plot globale

plot(model.FE, slab=paste(study))


###
###

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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 

[R] metafor - Cochrane on change score in pre-post design

2015-04-13 Thread Antonello Preti
Hi, this is another quesite related to the use of 'metafor' for calculation
of standardized mean change in pre-post design studies.
Essentially, my aim is to compare different method to arrive at the same
conclusion: Does the treatment work?

The Cochrane manual advise not to calculate change score:

9.4.5.2  Meta-analysis of change scores

In some circumstances an analysis based on changes from baseline will be
more efficient and powerful than comparison of final values,
as it removes a component of between-person variability from the analysis.
However, calculation of a change score requires measurement of the outcome
twice
and in practice may be less efficient for outcomes which are unstable or
difficult to measure precisely,
where the measurement error may be larger than true between-person baseline
variability.
Change-from-baseline outcomes may also be preferred if they have a less
skewed distribution than final measurement outcomes.
Although sometimes used as a device to ‘correct’ for unlucky randomization,
this practice is not recommended.

The preferred statistical approach to accounting for baseline measurements
of the outcome variable
is to include the baseline outcome measurements as a covariate in a
regression model or analysis of covariance (ANCOVA).

My question is: how do include both baseline (experimental and control
group)  in the analysis as a covariate in 'metafor'?
So, far, this is what I did.
I kinly request some help tp add the baseline as covariate to comply with
the Cochrane suggestion-
How can I add the baseline mean in both groups?
Should I consider baseline standard deviation, and if yes, how?
Should I take into account dropouts? I mean, in some sample at baseline n =
30 and 35 and at end of treatment n was 28 and 29...



Thank you in advance,
Antonello Preti




This is my dataset (with imputed r = 0.70 for pre-post correlation, put in
the 'ri' variable):

# the data

dat - structure(list(study = structure(c(11L, 8L, 7L, 12L, 13L, 4L,
5L, 1L, 10L, 3L, 6L, 9L, 2L), .Label = c(Study A, 2012,
Study B, 2013, Study C, 2013, Study D, 2010,
Study E, 2012, Study F, 2013, Study G, 2006,
Study H, 2005, Study I, 2013, Study L, 2012,
Study M, 2003, Study N, 2007, Study P, 2007
), class = factor), c_pre_mean = c(4.9, 15.18, 19.01, 5.1,
16.5, 27.35, 18.1, 2.4, 14.23, 0.08, 21.26, 21.5, 21.73), c_pre_sd = c(2.6,
2.21, 7.1, 1.5, 7.2, 13.92, 5.4, 0.13, 4.89, 0.94, 7.65, 5.22,
8.43), c_post_mean = c(6.1, 13.98, 18.5, 4.53, 15.9, 23, 16.9,
2.2, 16.58, -0.02, 16, 16.84, 23.54), c_post_sd = c(2.06, 3.24,
7, 2.06, 6.8, 12.06, 3.8, 0.13, 6.35, 0.88, 4.69, 4.64, 6.74),
c_sample = c(14, 13, 19, 15, 34, 20, 24, 35, 31, 26, 49,
21, 22), e_pre_mean = c(4.6, 13.81, 19.9, 5.3, 18.7, 22.71,
19.2, 2.7, 15.97, -0.22, 20.9, 20.43, 21.94), e_pre_sd = c(2.1,
6.64, 8.1, 2.9, 7.3, 7.82, 4.1, 0.13, 6.73, 0.93, 5.18, 4.87,
7.02), e_post_mean = c(4.64, 15.86, 18.1, 4.33, 17.2, 24.89,
17.6, 2.8, 13.6, 0.06, 17.41, 16.05, 19.29), e_post_sd = c(2.34,
7.76, 7.8, 2.26, 7.4, 11.89, 3.7, 0.13, 5.79, 1.12, 5.16,
4.17, 6.58), e_sample = c(14, 18, 16, 16, 33, 28, 29, 36,
38, 27, 43, 25, 17), ri = c(.70,
.70,.70,.70,.70,.70,.70,.70,.70,.70,.70,.70,.70)), .Names = c(study,
c_pre_mean, c_pre_sd,
c_post_mean, c_post_sd, c_sample, e_pre_mean, e_pre_sd,
e_post_mean, e_post_sd, e_sample, ri), class = data.frame,
row.names = c(NA,
-13L))


### check the data

dim(dat)
head(dat)
str(dat)

attach(dat)  yes, I know, do'nt do this

# call the library

library(metafor)


# Computing Standardized Mean Difference (Hedges' g) for Each Group
(experimental and control) at post treatment
# use SMD for the standardized mean difference using raw score
standardization

datT - escalc(measure=SMD, m1i=e_post_mean, sd1i=e_post_sd,
n1i=e_sample, m2i=c_post_mean, sd2i=c_post_sd, n2i=c_sample, vtype=UB,
data=dat, append=TRUE)


# Extract the effect size ( Standardized Mean Difference (Hedges' g)) and
its variance

yi - datT$yi
vi - datT$vi



###
#
# fixed-effects model
#
###

model.FE - rma(yi, vi, method=FE, digits=2)

summary(model.FE)

# plot globale

plot(model.FE, slab=paste(study))

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] metafor - code for analysing geometric means

2014-12-07 Thread Purssell, Ed
Dear All

I have tried very hard to work out what to do with putting logged data into 
metafor; the paper says..
'geometric mean antibody concentrations (GMCs) or opsonophagocytic activity 
titres (geometric mean titres [GMT]) were calculated with 95% CIs by taking the 
antilog of the mean of the log concentration or titre transformations.'

Does this look right if I take the reported mean, upper and lower bound of the 
CI, and the number?

m-log(mean) 
ub-log(upper bound)
lb-log(lower bound)
diff-ub-lb
SE-diff/3.92
SD-SE*(sqrt(n))

Then put m, SD and n for each group into metafor as normal.  Or is there a 
better way?  I am afraid I didn't understand how to do it on a log scale.

Thank you

Edward

Edward Purssell PhD
Senior Lecturer

Florence Nightingale Faculty of Nursing and Midwifery
King's College London
James Clerk Maxwell Building
57 Waterloo Road
London SE1 8WA
Telephone 020 7848 3021
Mobile 07782 374217
email edward.purss...@kcl.ac.uk
https://www.researchgate.net/profile/Edward_Purssell


From: Viechtbauer Wolfgang (STAT) wolfgang.viechtba...@maastrichtuniversity.nl
Sent: 14 November 2014 10:40
To: Michael Dewey; Purssell, Ed; r-help@r-project.org
Subject: RE: [R] metafor - code for analysing geometric means

With geometric mean 1 CI /3.92, I assume you mean (upper bound - lower 
bound) / 3.92. Two things:

1) That will give you the SE of the mean, not the SD of the observations (which 
is what you need as input).

2) Probably the CI for the geometric mean was calculated on the log-scale (as 
Michael hinted at). Check if log(upper bound) and log(lower bound) is (within 
rounding error) symmetric around log(geometric mean). Then (log(upper bound) - 
log(lower bound)) / 3.96 * sqrt(n) will give you the SD of the log of the 
values used to compute the geometric mean. Then you could use log(geometric 
mean) and that SD as input. But this would give you the difference of the 
log-transformed geometric means. Not sure if this is what you want to analyze.

Two more articles that may be helpful here:

Friedrich, J. O., Adhikari, N. K.,  Beyene, J. (2012). Ratio of geometric 
means to analyze continuous outcomes in meta-analysis: Comparison to mean 
differences and ratio of arithmetic means using empiric data and simulation. 
Statistics in Medicine, 31(17), 1857-1886.

Souverein, O. W., Dullemeijer, C., van 't Veer, P.,  van der Voet, H. (2012). 
Transformations of summary statistics as input in meta-analysis for linear 
dose-response models on a logarithmic scale: A methodology developed within 
EURRECA. BMC Medical Research Methodology, 12(57).

Best,
Wolfgang

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of Michael Dewey
 Sent: Thursday, November 13, 2014 12:36
 To: Purssell, Ed; r-help@r-project.org
 Subject: Re: [R] metafor - code for analysing geometric means

 On 13/11/2014 11:00, Purssell, Ed wrote:
  ?Dear All
 
  I have some data expressed in geometric means and 95% confidence
 intervals.  Can I code them in metafor as:
 
  rma(m1i=geometric mean 1, m2i=geometric mean 2, sd1i=geometric mean 1
 CI /3.92, sd2i=geometric mean 2 CI/3.92...etc, measure=MD)

 Would it not be better to work on the log scale?

  All of the studies use geometric means.
 
  Thanks!
 
  Edward

 --
 Michael
 http://www.dewey.myzen.co.uk

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] metafor - code for analysing geometric means

2014-12-07 Thread Bert Gunter
While you may get a helpful reply, I think this is really not the
forum for such relatively basic math/stat questions. As you seem to be
more or less at sea here, I really really suggest that you seek help
from a local statistical resource.

Cheers,
Bert

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom.
Clifford Stoll




On Sun, Dec 7, 2014 at 10:25 PM, Purssell, Ed ed.purss...@kcl.ac.uk wrote:
 Dear All

 I have tried very hard to work out what to do with putting logged data into 
 metafor; the paper says..
 'geometric mean antibody concentrations (GMCs) or opsonophagocytic activity 
 titres (geometric mean titres [GMT]) were calculated with 95% CIs by taking 
 the antilog of the mean of the log concentration or titre transformations.'

 Does this look right if I take the reported mean, upper and lower bound of 
 the CI, and the number?

 m-log(mean)
 ub-log(upper bound)
 lb-log(lower bound)
 diff-ub-lb
 SE-diff/3.92
 SD-SE*(sqrt(n))

 Then put m, SD and n for each group into metafor as normal.  Or is there a 
 better way?  I am afraid I didn't understand how to do it on a log scale.

 Thank you

 Edward
 
 Edward Purssell PhD
 Senior Lecturer

 Florence Nightingale Faculty of Nursing and Midwifery
 King's College London
 James Clerk Maxwell Building
 57 Waterloo Road
 London SE1 8WA
 Telephone 020 7848 3021
 Mobile 07782 374217
 email edward.purss...@kcl.ac.uk
 https://www.researchgate.net/profile/Edward_Purssell

 
 From: Viechtbauer Wolfgang (STAT) 
 wolfgang.viechtba...@maastrichtuniversity.nl
 Sent: 14 November 2014 10:40
 To: Michael Dewey; Purssell, Ed; r-help@r-project.org
 Subject: RE: [R] metafor - code for analysing geometric means

 With geometric mean 1 CI /3.92, I assume you mean (upper bound - lower 
 bound) / 3.92. Two things:

 1) That will give you the SE of the mean, not the SD of the observations 
 (which is what you need as input).

 2) Probably the CI for the geometric mean was calculated on the log-scale (as 
 Michael hinted at). Check if log(upper bound) and log(lower bound) is (within 
 rounding error) symmetric around log(geometric mean). Then (log(upper bound) 
 - log(lower bound)) / 3.96 * sqrt(n) will give you the SD of the log of the 
 values used to compute the geometric mean. Then you could use log(geometric 
 mean) and that SD as input. But this would give you the difference of the 
 log-transformed geometric means. Not sure if this is what you want to analyze.

 Two more articles that may be helpful here:

 Friedrich, J. O., Adhikari, N. K.,  Beyene, J. (2012). Ratio of geometric 
 means to analyze continuous outcomes in meta-analysis: Comparison to mean 
 differences and ratio of arithmetic means using empiric data and simulation. 
 Statistics in Medicine, 31(17), 1857-1886.

 Souverein, O. W., Dullemeijer, C., van 't Veer, P.,  van der Voet, H. 
 (2012). Transformations of summary statistics as input in meta-analysis for 
 linear dose-response models on a logarithmic scale: A methodology developed 
 within EURRECA. BMC Medical Research Methodology, 12(57).

 Best,
 Wolfgang

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of Michael Dewey
 Sent: Thursday, November 13, 2014 12:36
 To: Purssell, Ed; r-help@r-project.org
 Subject: Re: [R] metafor - code for analysing geometric means

 On 13/11/2014 11:00, Purssell, Ed wrote:
  ?Dear All
 
  I have some data expressed in geometric means and 95% confidence
 intervals.  Can I code them in metafor as:
 
  rma(m1i=geometric mean 1, m2i=geometric mean 2, sd1i=geometric mean 1
 CI /3.92, sd2i=geometric mean 2 CI/3.92...etc, measure=MD)

 Would it not be better to work on the log scale?

  All of the studies use geometric means.
 
  Thanks!
 
  Edward

 --
 Michael
 http://www.dewey.myzen.co.uk

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] metafor - code for analysing geometric means

2014-11-14 Thread Viechtbauer Wolfgang (STAT)
With geometric mean 1 CI /3.92, I assume you mean (upper bound - lower 
bound) / 3.92. Two things:

1) That will give you the SE of the mean, not the SD of the observations (which 
is what you need as input).

2) Probably the CI for the geometric mean was calculated on the log-scale (as 
Michael hinted at). Check if log(upper bound) and log(lower bound) is (within 
rounding error) symmetric around log(geometric mean). Then (log(upper bound) - 
log(lower bound)) / 3.96 * sqrt(n) will give you the SD of the log of the 
values used to compute the geometric mean. Then you could use log(geometric 
mean) and that SD as input. But this would give you the difference of the 
log-transformed geometric means. Not sure if this is what you want to analyze.

Two more articles that may be helpful here:

Friedrich, J. O., Adhikari, N. K.,  Beyene, J. (2012). Ratio of geometric 
means to analyze continuous outcomes in meta-analysis: Comparison to mean 
differences and ratio of arithmetic means using empiric data and simulation. 
Statistics in Medicine, 31(17), 1857-1886.

Souverein, O. W., Dullemeijer, C., van 't Veer, P.,  van der Voet, H. (2012). 
Transformations of summary statistics as input in meta-analysis for linear 
dose-response models on a logarithmic scale: A methodology developed within 
EURRECA. BMC Medical Research Methodology, 12(57).

Best,
Wolfgang

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of Michael Dewey
 Sent: Thursday, November 13, 2014 12:36
 To: Purssell, Ed; r-help@r-project.org
 Subject: Re: [R] metafor - code for analysing geometric means
 
 On 13/11/2014 11:00, Purssell, Ed wrote:
  ?Dear All
 
  I have some data expressed in geometric means and 95% confidence
 intervals.  Can I code them in metafor as:
 
  rma(m1i=geometric mean 1, m2i=geometric mean 2, sd1i=geometric mean 1
 CI /3.92, sd2i=geometric mean 2 CI/3.92...etc, measure=MD)
 
 Would it not be better to work on the log scale?
 
  All of the studies use geometric means.
 
  Thanks!
 
  Edward
 
 --
 Michael
 http://www.dewey.myzen.co.uk

__
R-help@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.


[R] metafor - code for analysing geometric means

2014-11-13 Thread Purssell, Ed
?Dear All


I have some data expressed in geometric means and 95% confidence intervals.  
Can I code them in metafor as:


rma(m1i=geometric mean 1, m2i=geometric mean 2, sd1i=geometric mean 1 CI /3.92, 
sd2i=geometric mean 2 CI/3.92...etc, measure=MD)

All of the studies use geometric means.


Thanks!


Edward

 


[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] metafor - code for analysing geometric means

2014-11-13 Thread Michael Dewey



On 13/11/2014 11:00, Purssell, Ed wrote:

?Dear All


I have some data expressed in geometric means and 95% confidence intervals.  
Can I code them in metafor as:


rma(m1i=geometric mean 1, m2i=geometric mean 2, sd1i=geometric mean 1 CI /3.92, 
sd2i=geometric mean 2 CI/3.92...etc, measure=MD)


Would it not be better to work on the log scale?


All of the studies use geometric means.


Thanks!


Edward

  


[[alternative HTML version deleted]]

__
R-help@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.


-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.5557 / Virus Database: 4213/8565 - Release Date: 11/13/14




--
Michael
http://www.dewey.myzen.co.uk

__
R-help@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.


Re: [R] Metafor -can't calculate heterogeneity with non-positive sampling variances

2014-08-28 Thread Michael Dewey

At 16:38 27/08/2014, Owen, Branwen wrote:
Thank you very much for your quick reply Wolfgang. The 0 does make 
sense - I'm working on some behavioural data and in one study none 
reported that particular behaviour. Up til now I have been 
calculating I2 without that study, as it's on the small side I don't 
think it makes much difference. I'm just beginning to wonder if 
there is another way.


Branwen
I have not tried this but if your dataset contains proportions as 
your text implies then why not supply xi and ni to rma.uni and then 
get it to compute one of the range of options outlined in the 
documentation for escalc? The Freeman-Tukey one might be worth considering.


Of course I may have misunderstood your brief description.

I'll think about it some more best wishes Branwen 
 From: Viechtbauer Wolfgang 
(STAT) [wolfgang.viechtba...@maastrichtuniversity.nl] Sent: 27 
August 2014 17:30 To: Owen, Branwen; r-help@r-project.org Subject: 
RE: [R] Metafor -can't calculate heterogeneity with non-positive 
sampling variances The warning message pretty much says it: When one 
of the variances is zero, then the I^2 statistic (and various other 
things) cannot be computed, at least if one sticks to the usual 
equations/methods. So, if you think the 0 sampling variances really 
make sense and you really want to get something like I^2, you will 
have to come up with a creative solution. On the metafor package 
website, I explain how I^2 is computed (for the random-effects 
model): 
http://www.metafor-project.org/doku.php/faq#how_are_i_2_and_h_2_computed_i 
The crux of the problem is how to compute the 'typical' within-study 
variance (s^2). With any vi=0, you get division by zero in the 
equation given. So, you will have to compute s^2 in a different way. 
You could leave out the studies where vi=0, but this doesn't seem 
quite right, because this will inflate s^2. You could just take the 
simple average of the vi values and use that for s^2, but then it's 
not really I^2 anymore (it's I^2-like). My question would be: How 
come you have studies where the sampling variance is estimated to be 
zero and does that really make sense? Maybe the solution is not to 
fix the computation of I^2, but to consider if vi=0 is really 
sensible. Best, Wolfgang  -Original Message-  From: 
r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]  
On Behalf Of Owen, Branwen  Sent: Wednesday, August 27, 2014 
13:48  To: r-help@r-project.org  Subject: [R] Metafor -can't 
calculate heterogeneity with non-positive  sampling variances   
Hi, I'm doing a meta-analysis in metafor. All is fine except when 
there  are 0s in the values that i'm pooling, then i get a pooled 
estimate but  not the I2 that i am also interested in.  for 
example:   summary(rma.1-  
rma(yi,vi,data=mix,method=ML,knha=F,weighted=F,intercept=T))  
(where yi are the study outcomes, one of which is 0, and vi is the  
variance of the study outcomes)   Random-Effects Model (k = 17; 
tau^2 estimator: 
ML) logLik  deviance   AIC   BIC  AICc   13.0539 
 Inf  -22.1077  -20.4413  -21.2506   tau^2 (estimated amount 
of total heterogeneity): 0.0119 (SE = 0.0043)  tau (square root of 
estimated tau^2 value):  0.1089   Model Results:   
estimate   se zval pvalci.lbci.ub0.1837 
0.0274   6.7154   .0001   0.1301   0.2374  ***   ---  
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1   
Warning messages:  1: In rma(yi, vi, data = mix, method = ML, 
knha = F, weighted = F,  :There are outcomes with non-positive 
sampling variances.  2: In rma(yi, vi, data = mix, method = ML, 
knha = F, weighted = F,  :Cannot compute Q-test, I^2, or H^2 
with non-positive sampling  variances.   Is there any way around 
this?  thanks  Branwen  
  From: 
r-help-boun...@r-project.org [r-help-boun...@r-project.org] on  
behalf of r-help-ow...@r-project.org [r-help-ow...@r-project.org]  
Sent: 27 August 2014 13:36  To: Owen, Branwen  Subject: Metafor 
-can't calculate heterogeneity with non-positive  sampling 
variances   Message rejected by filter rule match
__  
R-help@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.


Michael Dewey
i...@aghmed.fsnet.co.uk
http://www.aghmed.fsnet.co.uk/home.html

__
R-help@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.


[R] Metafor -can't calculate heterogeneity with non-positive sampling variances

2014-08-27 Thread Owen, Branwen
Hi, I'm doing a meta-analysis in metafor. All is fine except when there are 0s 
in the values that i'm pooling, then i get a pooled estimate but not the I2 
that i am also interested in.
for example:

summary(rma.1-rma(yi,vi,data=mix,method=ML,knha=F,weighted=F,intercept=T))
(where yi are the study outcomes, one of which is 0, and vi is the variance of 
the study outcomes)

Random-Effects Model (k = 17; tau^2 estimator: ML)

  logLik  deviance   AIC   BIC  AICc  
 13.0539   Inf  -22.1077  -20.4413  -21.2506  

tau^2 (estimated amount of total heterogeneity): 0.0119 (SE = 0.0043)
tau (square root of estimated tau^2 value):  0.1089

Model Results:

estimate   se zval pvalci.lbci.ub  
  0.1837   0.0274   6.7154   .0001   0.1301   0.2374  ***

---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Warning messages:
1: In rma(yi, vi, data = mix, method = ML, knha = F, weighted = F,  :
  There are outcomes with non-positive sampling variances.
2: In rma(yi, vi, data = mix, method = ML, knha = F, weighted = F,  :
  Cannot compute Q-test, I^2, or H^2 with non-positive sampling variances.

Is there any way around this?
thanks
Branwen

From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] on behalf of 
r-help-ow...@r-project.org [r-help-ow...@r-project.org]
Sent: 27 August 2014 13:36
To: Owen, Branwen
Subject: Metafor -can't calculate heterogeneity with non-positive sampling 
variances

Message rejected by filter rule match


__
R-help@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.


Re: [R] Metafor -can't calculate heterogeneity with non-positive sampling variances

2014-08-27 Thread Viechtbauer Wolfgang (STAT)
The warning message pretty much says it: When one of the variances is zero, 
then the I^2 statistic (and various other things) cannot be computed, at least 
if one sticks to the usual equations/methods. So, if you think the 0 sampling 
variances really make sense and you really want to get something like I^2, you 
will have to come up with a creative solution.

On the metafor package website, I explain how I^2 is computed (for the 
random-effects model):

http://www.metafor-project.org/doku.php/faq#how_are_i_2_and_h_2_computed_i

The crux of the problem is how to compute the 'typical' within-study variance 
(s^2). With any vi=0, you get division by zero in the equation given. So, you 
will have to compute s^2 in a different way. You could leave out the studies 
where vi=0, but this doesn't seem quite right, because this will inflate s^2. 
You could just take the simple average of the vi values and use that for s^2, 
but then it's not really I^2 anymore (it's I^2-like).

My question would be: How come you have studies where the sampling variance is 
estimated to be zero and does that really make sense? Maybe the solution is not 
to fix the computation of I^2, but to consider if vi=0 is really sensible.

Best,
Wolfgang

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of Owen, Branwen
 Sent: Wednesday, August 27, 2014 13:48
 To: r-help@r-project.org
 Subject: [R] Metafor -can't calculate heterogeneity with non-positive
 sampling variances
 
 Hi, I'm doing a meta-analysis in metafor. All is fine except when there
 are 0s in the values that i'm pooling, then i get a pooled estimate but
 not the I2 that i am also interested in.
 for example:
 
 summary(rma.1-
 rma(yi,vi,data=mix,method=ML,knha=F,weighted=F,intercept=T))
 (where yi are the study outcomes, one of which is 0, and vi is the
 variance of the study outcomes)
 
 Random-Effects Model (k = 17; tau^2 estimator: ML)
 
   logLik  deviance   AIC   BIC  AICc
  13.0539   Inf  -22.1077  -20.4413  -21.2506
 
 tau^2 (estimated amount of total heterogeneity): 0.0119 (SE = 0.0043)
 tau (square root of estimated tau^2 value):  0.1089
 
 Model Results:
 
 estimate   se zval pvalci.lbci.ub
   0.1837   0.0274   6.7154   .0001   0.1301   0.2374  ***
 
 ---
 Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
 
 Warning messages:
 1: In rma(yi, vi, data = mix, method = ML, knha = F, weighted = F,  :
   There are outcomes with non-positive sampling variances.
 2: In rma(yi, vi, data = mix, method = ML, knha = F, weighted = F,  :
   Cannot compute Q-test, I^2, or H^2 with non-positive sampling
 variances.
 
 Is there any way around this?
 thanks
 Branwen
 
 From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] on
 behalf of r-help-ow...@r-project.org [r-help-ow...@r-project.org]
 Sent: 27 August 2014 13:36
 To: Owen, Branwen
 Subject: Metafor -can't calculate heterogeneity with non-positive
 sampling variances
 
 Message rejected by filter rule match
 
 
 __
 R-help@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.

__
R-help@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.


Re: [R] Metafor -can't calculate heterogeneity with non-positive sampling variances

2014-08-27 Thread Owen, Branwen
Thank you very much for your quick reply Wolfgang. The 0 does make sense - I'm 
working on some behavioural data and in one study none reported that particular 
behaviour. Up til now I have been calculating I2 without that study, as it's on 
the small side I don't think it makes much difference. I'm just beginning to 
wonder if there is another way. 

I'll think about it some more
best wishes
Branwen

From: Viechtbauer Wolfgang (STAT) [wolfgang.viechtba...@maastrichtuniversity.nl]
Sent: 27 August 2014 17:30
To: Owen, Branwen; r-help@r-project.org
Subject: RE: [R] Metafor -can't calculate heterogeneity with non-positive 
sampling variances

The warning message pretty much says it: When one of the variances is zero, 
then the I^2 statistic (and various other things) cannot be computed, at least 
if one sticks to the usual equations/methods. So, if you think the 0 sampling 
variances really make sense and you really want to get something like I^2, you 
will have to come up with a creative solution.

On the metafor package website, I explain how I^2 is computed (for the 
random-effects model):

http://www.metafor-project.org/doku.php/faq#how_are_i_2_and_h_2_computed_i

The crux of the problem is how to compute the 'typical' within-study variance 
(s^2). With any vi=0, you get division by zero in the equation given. So, you 
will have to compute s^2 in a different way. You could leave out the studies 
where vi=0, but this doesn't seem quite right, because this will inflate s^2. 
You could just take the simple average of the vi values and use that for s^2, 
but then it's not really I^2 anymore (it's I^2-like).

My question would be: How come you have studies where the sampling variance is 
estimated to be zero and does that really make sense? Maybe the solution is not 
to fix the computation of I^2, but to consider if vi=0 is really sensible.

Best,
Wolfgang

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of Owen, Branwen
 Sent: Wednesday, August 27, 2014 13:48
 To: r-help@r-project.org
 Subject: [R] Metafor -can't calculate heterogeneity with non-positive
 sampling variances

 Hi, I'm doing a meta-analysis in metafor. All is fine except when there
 are 0s in the values that i'm pooling, then i get a pooled estimate but
 not the I2 that i am also interested in.
 for example:

 summary(rma.1-
 rma(yi,vi,data=mix,method=ML,knha=F,weighted=F,intercept=T))
 (where yi are the study outcomes, one of which is 0, and vi is the
 variance of the study outcomes)

 Random-Effects Model (k = 17; tau^2 estimator: ML)

   logLik  deviance   AIC   BIC  AICc
  13.0539   Inf  -22.1077  -20.4413  -21.2506

 tau^2 (estimated amount of total heterogeneity): 0.0119 (SE = 0.0043)
 tau (square root of estimated tau^2 value):  0.1089

 Model Results:

 estimate   se zval pvalci.lbci.ub
   0.1837   0.0274   6.7154   .0001   0.1301   0.2374  ***

 ---
 Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

 Warning messages:
 1: In rma(yi, vi, data = mix, method = ML, knha = F, weighted = F,  :
   There are outcomes with non-positive sampling variances.
 2: In rma(yi, vi, data = mix, method = ML, knha = F, weighted = F,  :
   Cannot compute Q-test, I^2, or H^2 with non-positive sampling
 variances.

 Is there any way around this?
 thanks
 Branwen
 
 From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] on
 behalf of r-help-ow...@r-project.org [r-help-ow...@r-project.org]
 Sent: 27 August 2014 13:36
 To: Owen, Branwen
 Subject: Metafor -can't calculate heterogeneity with non-positive
 sampling variances

 Message rejected by filter rule match


 __
 R-help@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.

__
R-help@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.


Re: [R] metafor package: changing decimal in forest plot to midline decimal

2014-07-07 Thread Viechtbauer Wolfgang (STAT)
I tried this:

library(metafor)
data(dat.bcg)
res - rma(measure=RR, ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg, 
slab=paste(author, year, sep=, ))
options(OutDec=\xB7)
forest(res)

No warning, no scrambling, and all decimals shown in midline (also on the 
x-axis). But this is on Windows.

My guess it's a font issue. There may be others that can give more useful 
advice.

Best,
Wolfgang

 -Original Message-
 From: Dietlinde Schmidt [mailto:schmidt.dietli...@web.de]
 Sent: Monday, July 07, 2014 10:09
 To: Viechtbauer Wolfgang (STAT); r-help@r-project.org
 Subject: Re: [R] metafor package: changing decimal in forest plot to
 midline decimal
 
 Thanks for that link, Wolfgang. Unfortunately, there comes the Warning
 with it:
 (process:3634): Pango-WARNING **: Invalid UTF-8 string passed to
 pango_layout_set_text()
 and decimal being scrambled in forest plot and not displaying the
 midline decimal.
 
 I think it has to do with the fact, that only 1-byte-codes are allowed
 for options(OutDec=\xB7).
 Or does it have to do with me using Ubuntu?
 
 Apart from that the options-command does not seem to change the decimal
 of values on the true x-axis under the plot.
 
 Still searching for a solution.
 
 Cheers,
 Linde
 
 Am 05.07.2014 19:06, schrieb Viechtbauer Wolfgang (STAT):
  I found this:
 
  https://stat.ethz.ch/pipermail/r-help/2012-August/321057.html
 
  So, use this before drawing the forest plot:
 
  options(OutDec=\xB7)
 
  Best,
  Wolfgang
 
  --
  Wolfgang Viechtbauer, Ph.D., Statistician
  Department of Psychiatry and Psychology
  School for Mental Health and Neuroscience
  Faculty of Health, Medicine, and Life Sciences
  Maastricht University, P.O. Box 616 (VIJV1)
  6200 MD Maastricht, The Netherlands
  +31 (43) 388-4170 | http://www.wvbauer.com
  
  From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On
 Behalf Of Dietlinde Schmidt [schmidt.dietli...@web.de]
  Sent: Thursday, July 03, 2014 3:07 PM
  To: r-help@r-project.org
  Subject: [R] metafor package: changing decimal in forest plot to
 midlinedecimal
 
  Dear R-Community,
 
  I need to change the punctuation of the reported weights, effect sizes
  and confidence intervals in a forest plot created with the
  forest()-function in the metafor-package.
 
  Midline decimal means that it looks like this (23*6) rather than that
  (23.6).
 
  Do I need to change the forest()-function and if yes which part
 exactly?
  Or is there an otherway how I can do it maybe by changing the
  rma()-function, of which the forest()-function is then applied to?
 
  Thanks for any hints and tipps!
 
  Cheers, Linde
 
  __
  R-help@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.

__
R-help@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.


Re: [R] metafor package: changing decimal in forest plot to midline decimal

2014-07-07 Thread Dietlinde Schmidt
Thanks for that link, Wolfgang. Unfortunately, there comes the Warning 
with it:
(process:3634): Pango-WARNING **: Invalid UTF-8 string passed to 
pango_layout_set_text()
and decimal being scrambled in forest plot and not displaying the 
midline decimal.


I think it has to do with the fact, that only 1-byte-codes are allowed 
for options(OutDec=\xB7).

Or does it have to do with me using Ubuntu?

Apart from that the options-command does not seem to change the decimal 
of values on the true x-axis under the plot.


Still searching for a solution.

Cheers,
Linde

Am 05.07.2014 19:06, schrieb Viechtbauer Wolfgang (STAT):

I found this:

https://stat.ethz.ch/pipermail/r-help/2012-August/321057.html

So, use this before drawing the forest plot:

options(OutDec=\xB7)

Best,
Wolfgang

--
Wolfgang Viechtbauer, Ph.D., Statistician
Department of Psychiatry and Psychology
School for Mental Health and Neuroscience
Faculty of Health, Medicine, and Life Sciences
Maastricht University, P.O. Box 616 (VIJV1)
6200 MD Maastricht, The Netherlands
+31 (43) 388-4170 | http://www.wvbauer.com

From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of 
Dietlinde Schmidt [schmidt.dietli...@web.de]
Sent: Thursday, July 03, 2014 3:07 PM
To: r-help@r-project.org
Subject: [R] metafor package: changing decimal in forest plot to midline
decimal

Dear R-Community,

I need to change the punctuation of the reported weights, effect sizes
and confidence intervals in a forest plot created with the
forest()-function in the metafor-package.

Midline decimal means that it looks like this (23·6) rather than that
(23.6).

Do I need to change the forest()-function and if yes which part exactly?
Or is there an otherway how I can do it maybe by changing the
rma()-function, of which the forest()-function is then applied to?

Thanks for any hints and tipps!

Cheers, Linde

__
R-help@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.


__
R-help@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.


Re: [R] metafor package: changing decimal in forest plot to midline decimal

2014-07-07 Thread Jeremy Miles
I've found that if you want really fine control over an issue like this in
a chart, the easiest thing to do is to export it as PDF, and then directly
edit the chart in Illustrator (not free) or Inkscape (free).




On 7 July 2014 10:21, Viechtbauer Wolfgang (STAT) 
wolfgang.viechtba...@maastrichtuniversity.nl wrote:

 I tried this:

 library(metafor)
 data(dat.bcg)
 res - rma(measure=RR, ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg,
 slab=paste(author, year, sep=, ))
 options(OutDec=\xB7)
 forest(res)

 No warning, no scrambling, and all decimals shown in midline (also on the
 x-axis). But this is on Windows.

 My guess it's a font issue. There may be others that can give more useful
 advice.

 Best,
 Wolfgang

  -Original Message-
  From: Dietlinde Schmidt [mailto:schmidt.dietli...@web.de]
  Sent: Monday, July 07, 2014 10:09
  To: Viechtbauer Wolfgang (STAT); r-help@r-project.org
  Subject: Re: [R] metafor package: changing decimal in forest plot to
  midline decimal
 
  Thanks for that link, Wolfgang. Unfortunately, there comes the Warning
  with it:
  (process:3634): Pango-WARNING **: Invalid UTF-8 string passed to
  pango_layout_set_text()
  and decimal being scrambled in forest plot and not displaying the
  midline decimal.
 
  I think it has to do with the fact, that only 1-byte-codes are allowed
  for options(OutDec=\xB7).
  Or does it have to do with me using Ubuntu?
 
  Apart from that the options-command does not seem to change the decimal
  of values on the true x-axis under the plot.
 
  Still searching for a solution.
 
  Cheers,
  Linde
 
  Am 05.07.2014 19:06, schrieb Viechtbauer Wolfgang (STAT):
   I found this:
  
   https://stat.ethz.ch/pipermail/r-help/2012-August/321057.html
  
   So, use this before drawing the forest plot:
  
   options(OutDec=\xB7)
  
   Best,
   Wolfgang
  
   --
   Wolfgang Viechtbauer, Ph.D., Statistician
   Department of Psychiatry and Psychology
   School for Mental Health and Neuroscience
   Faculty of Health, Medicine, and Life Sciences
   Maastricht University, P.O. Box 616 (VIJV1)
   6200 MD Maastricht, The Netherlands
   +31 (43) 388-4170 | http://www.wvbauer.com
   
   From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On
  Behalf Of Dietlinde Schmidt [schmidt.dietli...@web.de]
   Sent: Thursday, July 03, 2014 3:07 PM
   To: r-help@r-project.org
   Subject: [R] metafor package: changing decimal in forest plot to
  midlinedecimal
  
   Dear R-Community,
  
   I need to change the punctuation of the reported weights, effect sizes
   and confidence intervals in a forest plot created with the
   forest()-function in the metafor-package.
  
   Midline decimal means that it looks like this (23*6) rather than that
   (23.6).
  
   Do I need to change the forest()-function and if yes which part
  exactly?
   Or is there an otherway how I can do it maybe by changing the
   rma()-function, of which the forest()-function is then applied to?
  
   Thanks for any hints and tipps!
  
   Cheers, Linde
  
   __
   R-help@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.

 __
 R-help@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.


[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] metafor package: changing decimal in forest plot to midline decimal

2014-07-07 Thread Michael Dewey

At 09:08 07/07/2014, Dietlinde Schmidt wrote:
Thanks for that link, Wolfgang. Unfortunately, 
there comes the Warning with it:
(process:3634): Pango-WARNING **: Invalid UTF-8 
string passed to pango_layout_set_text()
and decimal being scrambled in forest plot and 
not displaying the midline decimal.


I think it has to do with the fact, that only 
1-byte-codes are allowed for options(OutDec=\xB7).

Or does it have to do with me using Ubuntu?


I am not an expert on encodings but I think that 
in Unicode it is indeed two bytes but for some 
reason in the encoding used in Windows it is a 
single byte. It may be that some expert in 
encodings can tell you how to temporarily reset 
your locale in Ubuntu but I am not that expert.



Apart from that the options-command does not 
seem to change the decimal of values on the true x-axis under the plot.


Still searching for a solution.

Cheers,
Linde

Am 05.07.2014 19:06, schrieb Viechtbauer Wolfgang (STAT):

I found this:

https://stat.ethz.ch/pipermail/r-help/2012-August/321057.html

So, use this before drawing the forest plot:

options(OutDec=\xB7)

Best,
Wolfgang

--
Wolfgang Viechtbauer, Ph.D., Statistician
Department of Psychiatry and Psychology
School for Mental Health and Neuroscience
Faculty of Health, Medicine, and Life Sciences
Maastricht University, P.O. Box 616 (VIJV1)
6200 MD Maastricht, The Netherlands
+31 (43) 388-4170 | http://www.wvbauer.com

From: r-help-boun...@r-project.org 
[r-help-boun...@r-project.org] On Behalf Of 
Dietlinde Schmidt [schmidt.dietli...@web.de]

Sent: Thursday, July 03, 2014 3:07 PM
To: r-help@r-project.org
Subject: [R] metafor package: changing decimal 
in forest plot to midlinedecimal


Dear R-Community,

I need to change the punctuation of the reported weights, effect sizes
and confidence intervals in a forest plot created with the
forest()-function in the metafor-package.

Midline decimal means that it looks like this (23·6) rather than that
(23.6).

Do I need to change the forest()-function and if yes which part exactly?
Or is there an otherway how I can do it maybe by changing the
rma()-function, of which the forest()-function is then applied to?

Thanks for any hints and tipps!

Cheers, Linde

__
R-help@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.





Michael Dewey
i...@aghmed.fsnet.co.uk
http://www.aghmed.fsnet.co.uk/home.html

__
R-help@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.


Re: [R] metafor package: changing decimal in forest plot to midline decimal

2014-07-07 Thread Prof Brian Ripley

On 07/07/2014 12:02, Michael Dewey wrote:

At 09:08 07/07/2014, Dietlinde Schmidt wrote:

Thanks for that link, Wolfgang. Unfortunately, there comes the Warning
with it:
(process:3634): Pango-WARNING **: Invalid UTF-8 string passed to
pango_layout_set_text()
and decimal being scrambled in forest plot and not displaying the
midline decimal.

I think it has to do with the fact, that only 1-byte-codes are allowed
for options(OutDec=\xB7).
Or does it have to do with me using Ubuntu?


I am not an expert on encodings but I think that in Unicode it is indeed
two bytes but for some reason in the encoding used in Windows it is a
single byte. It may be that some expert in encodings can tell you how to
temporarily reset your locale in Ubuntu but I am not that expert.


All non-ASCII chars are two or more bytes in UTF-8: this one is c2 b7 in 
hex.


Ubuntu is based on Debian which micro-packages its encoding support.  On 
a standard Linux system you can just use (e.g.) LC_CTYPE=de_DE which is 
encoded in Latin-1.   That might not be installed on Debian/Ubuntu, in 
which case you need to install it.


OutDec is designed for outputting numbers in an internationalized way: 
no known locale uses a centred dot.  (If one did, you could most likely 
set LC_NUMERIC to such a locale instead.)






Apart from that the options-command does not seem to change the
decimal of values on the true x-axis under the plot.

Still searching for a solution.

Cheers,
Linde

Am 05.07.2014 19:06, schrieb Viechtbauer Wolfgang (STAT):

I found this:

https://stat.ethz.ch/pipermail/r-help/2012-August/321057.html

So, use this before drawing the forest plot:

options(OutDec=\xB7)

Best,
Wolfgang

--
Wolfgang Viechtbauer, Ph.D., Statistician
Department of Psychiatry and Psychology
School for Mental Health and Neuroscience
Faculty of Health, Medicine, and Life Sciences
Maastricht University, P.O. Box 616 (VIJV1)
6200 MD Maastricht, The Netherlands
+31 (43) 388-4170 | http://www.wvbauer.com

From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On
Behalf Of Dietlinde Schmidt [schmidt.dietli...@web.de]
Sent: Thursday, July 03, 2014 3:07 PM
To: r-help@r-project.org
Subject: [R] metafor package: changing decimal in forest plot to
midlinedecimal

Dear R-Community,

I need to change the punctuation of the reported weights, effect sizes
and confidence intervals in a forest plot created with the
forest()-function in the metafor-package.

Midline decimal means that it looks like this (23·6) rather than that
(23.6).

Do I need to change the forest()-function and if yes which part exactly?
Or is there an otherway how I can do it maybe by changing the
rma()-function, of which the forest()-function is then applied to?

Thanks for any hints and tipps!

Cheers, Linde

__
R-help@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.





Michael Dewey
i...@aghmed.fsnet.co.uk
http://www.aghmed.fsnet.co.uk/home.html

__
R-help@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.



--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@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.


Re: [R] metafor package: changing decimal in forest plot to midline decimal

2014-07-05 Thread Viechtbauer Wolfgang (STAT)
I found this:

https://stat.ethz.ch/pipermail/r-help/2012-August/321057.html

So, use this before drawing the forest plot:

options(OutDec=\xB7)

Best,
Wolfgang

--
Wolfgang Viechtbauer, Ph.D., Statistician
Department of Psychiatry and Psychology
School for Mental Health and Neuroscience
Faculty of Health, Medicine, and Life Sciences
Maastricht University, P.O. Box 616 (VIJV1)
6200 MD Maastricht, The Netherlands
+31 (43) 388-4170 | http://www.wvbauer.com

From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of 
Dietlinde Schmidt [schmidt.dietli...@web.de]
Sent: Thursday, July 03, 2014 3:07 PM
To: r-help@r-project.org
Subject: [R] metafor package: changing decimal in forest plot to midline
decimal

Dear R-Community,

I need to change the punctuation of the reported weights, effect sizes
and confidence intervals in a forest plot created with the
forest()-function in the metafor-package.

Midline decimal means that it looks like this (23·6) rather than that
(23.6).

Do I need to change the forest()-function and if yes which part exactly?
Or is there an otherway how I can do it maybe by changing the
rma()-function, of which the forest()-function is then applied to?

Thanks for any hints and tipps!

Cheers, Linde

__
R-help@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.
__
R-help@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.


[R] metafor package: changing decimal in forest plot to midline decimal

2014-07-03 Thread Dietlinde Schmidt

Dear R-Community,

I need to change the punctuation of the reported weights, effect sizes 
and confidence intervals in a forest plot created with the 
forest()-function in the metafor-package.


Midline decimal means that it looks like this (23·6) rather than that 
(23.6).


Do I need to change the forest()-function and if yes which part exactly?
Or is there an otherway how I can do it maybe by changing the 
rma()-function, of which the forest()-function is then applied to?


Thanks for any hints and tipps!

Cheers, Linde

__
R-help@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.


[R] Metafor: Strange Trim and Fill Outcome?

2014-05-26 Thread Verena Weinbir
Hey guys,

I have tested the metafor trim and fill function (y:SD, x:SMD)on my data
set and yielded the following result:

1. missing studies on the right: 34

2. open circles on the rights side appear to be the number of additional
effects

3. adjusted d would be higher than observed d.

Since normally, as I understand, those parameters are the other way round
(black dots indicating missing studies on the left, which would reduce the
effect size), I wonder:

Is there a mistake I have done? Or, if this is an actual outcome how can I
interpret this?  That its not a publication bias that influences my data
set, but a lack of precision (studies missing that are precise -small SD-
and have big SMD)?

Many thanks in advance!

Verena

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Metafor: How to integrate effectsizes?

2014-05-26 Thread Michael Dewey

At 13:10 22/05/2014, Verena Weinbir wrote:

Hello,

thank you very much for your replies. I am 
almost done :-) but theres one study left, where 
I only have sample size (not group size),  mean 
values and standarddeviations. Is there a way to 
compute cohens d from this data?


You could assume that the split was equal. If you 
are worried you could, as a sensitivity analysis, 
assume a plausible range of splits and see if 
that affects the outcome. If these are 
experiments or trials it is unlikely people would 
have arranged anything too asymmetrical.



I thought it was correct to use measure=SMDH 
in the escalc () function to compute cohens d? 
In your illustration, Wolfgang, you use SMD as measure - now I am confused ;-)


People usually use SMD I think, the other relaxes 
the assumption about homogeneity of variances.




Thank you very much in advance!

Best,
Verena


On Tue, May 6, 2014 at 7:14 PM, Michael Dewey 
mailto:i...@aghmed.fsnet.co.uki...@aghmed.fsnet.co.uk wrote:

At 14:23 06/05/2014, Viechtbauer Wolfgang (STAT) wrote:
Without the sample size of a study (i.e., either 
the group sizes or the total sample size), you 
cannot convert the p-value to a t-value or a 
t-value to a d-value. And for studies where you 
have the d-value but no sample size, you cannot 
compute the corresponding sampling variance. So, 
without additional information, you cannot 
include these studies. Maybe studies where a 
d-value is directly reported also report a CI 
for the d-value? Then the sampling variance can 
be back-calculated (since a 95% CI for d is 
typically computed with d +- 1.96 sqrt(vi), where vi is the sampling variance).



Verena,
What Wolfgang says is true of course but if you 
have _both_ the t value and the p value you can 
backcalculate the number of degrees of freedom 
and then if you are willing to assume equal arms you have the sample sizes.


finddf - function(t, pval) {
   helper - function(df) {res - pval - pt(t, df, lower.tail = FALSE); res}
   res - uniroot(helper, interval = c(5, 1))
   res
}

If you call finddf with the value of t and the 
_one-sided_ p-value (divide by 2 if two-sided) 
it should give you a return value which, if you 
look at the element of the list called root is 
its estimate of the degrees of freedom. If you 
get errors from uniroot the interval supplied in 
the call may need to be widened.


I would suggest that when you have your final 
dataset it would be a really good idea to do 
some model checks using plot.influence to see 
whether the studies for which you have imputed 
values are fundamentally different for some 
reason. This will also check your calculations as a bonus.



Best,
Wolfgang

 -Original Message-
 From: Verena Weinbir [mailto:vwein...@gmail.com]
 Sent: Tuesday, May 06, 2014 15:09
 To: Michael Dewey
 Cc: Viechtbauer Wolfgang (STAT); 
mailto:r-help@r-project.orgr-help@r-project.org

 Subject: Re: [R] Metafor: How to integrate effectsizes?

 Thank you very much for your illustration, Wolfgang! It helped me a
 lot.  And also thank you for the package-hint, Michael!


 Now, I have re-checked the respective studies, and there still are a
 couple of studies left, only stating cohens d, and the respective t-value
 and p-value - sample and group sizes are not addressed (its data from an
 older meta-analysis). Is there a way to embed these studies in my sample?
 Wolfgangs illustration addresses only cases in which group sizes are
 stated, if I understand you correctly...

 Many thanks in advance,

 Verena

 On Sat, Apr 26, 2014 at 1:38 PM, Michael 
Dewey mailto:i...@aghmed.fsnet.co.uki...@aghmed.fsnet.co.uk

 wrote:
 At 20:34 25/04/2014, Viechtbauer Wolfgang (STAT) wrote:
 If you know the d-value and the corresponding group sizes for a study,
 then it's possible to add that study to the rest of the dataset. Also, if
 you only know the test statistic from an independent samples t-test (or
 only the p-value corresponding to that test), it's possible to back-
 compute what the standardized mean difference is.

 I added an illustration of this to the metafor package website:

 
http://www.metafor-project.org/doku.php/tips:assembling_data_smdhttp://www.metafor-project.org/doku.php/tips:assembling_data_smd


 Verena might also like to look at the 
http://compute.escompute.es package available from

 CRAN to see whether any of the conversions programmed there do the job.


 Best,
 Wolfgang

 --
 Wolfgang Viechtbauer, Ph.D., Statistician
 Department of Psychiatry and Psychology
 School for Mental Health and Neuroscience
 Faculty of Health, Medicine, and Life Sciences
 Maastricht University, P.O. Box 616 (VIJV1)
 6200 MD Maastricht, The Netherlands
 +31 (43) 388-4170Â | http://www.wvbauer.comhttp://www.wvbauer.com


  -Original Message-
  From: 
mailto:r-help-boun...@r-project.orgr-help-boun...@r-project.org 
[mailto:mailto:r-help-bounces@r-r-help-bounces@r-

 http://project.orgproject.org]
  On Behalf Of Michael Dewey
  Sent

Re: [R] Metafor: Strange Trim and Fill Outcome?

2014-05-26 Thread Michael Dewey

At 09:34 26/05/2014, Verena Weinbir wrote:

Hey guys,

I have tested the metafor trim and fill function (y:SD, x:SMD)on my data
set and yielded the following result:

1. missing studies on the right: 34


That seems a lot of missing studies unless you have a very large set 
of primary studies.




2. open circles on the rights side appear to be the number of additional
effects

3. adjusted d would be higher than observed d.


Implying that the mechanism is suppressing studies which found a 
large effect. This might happen if the dominant view is that there is 
no effect and so when people find one they worry about their results.




Since normally, as I understand, those parameters are the other way round
(black dots indicating missing studies on the left, which would reduce the
effect size), I wonder:

Is there a mistake I have done? Or, if this is an actual outcome how can I
interpret this?  That its not a publication bias that influences my data
set, but a lack of precision (studies missing that are precise -small SD-
and have big SMD)?


Sorry but that bit is not very clear to me.


Many thanks in advance!

Verena

[[alternative HTML version deleted]]


Michael Dewey
i...@aghmed.fsnet.co.uk
http://www.aghmed.fsnet.co.uk/home.html

__
R-help@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.


Re: [R] Metafor: Strange Trim and Fill Outcome?

2014-05-26 Thread Verena Weinbir
thanks for your reply, Michael!

ad primary studies:
yup, I have a large set of studies: At the moment I consider 126 data sets
in my analysis.

ad interpretation:
thats an interesting information. But usually there should be found an
effect.

ad bit :-):
I am irritiated, because in the plots I have studied so far, I always found
that the observed studies are open circles and the additional mirrored
effects are black dots. In my case, it is the other way round.

Also, most of the mirrored circels appear in the right upper corner,
indicating, that there are studies missing in my data set, which have
smaller SDs (i.e. are more precise?) and higher effect sizes?

best,

Verena




On Mon, May 26, 2014 at 12:26 PM, Michael Dewey i...@aghmed.fsnet.co.ukwrote:

 At 09:34 26/05/2014, Verena Weinbir wrote:

 Hey guys,

 I have tested the metafor trim and fill function (y:SD, x:SMD)on my data
 set and yielded the following result:

 1. missing studies on the right: 34


 That seems a lot of missing studies unless you have a very large set of
 primary studies.



  2. open circles on the rights side appear to be the number of additional
 effects

 3. adjusted d would be higher than observed d.


 Implying that the mechanism is suppressing studies which found a large
 effect. This might happen if the dominant view is that there is no effect
 and so when people find one they worry about their results.



  Since normally, as I understand, those parameters are the other way round
 (black dots indicating missing studies on the left, which would reduce the
 effect size), I wonder:

 Is there a mistake I have done? Or, if this is an actual outcome how can I
 interpret this?  That its not a publication bias that influences my data
 set, but a lack of precision (studies missing that are precise -small SD-
 and have big SMD)?


 Sorry but that bit is not very clear to me.

  Many thanks in advance!

 Verena

 [[alternative HTML version deleted]]


 Michael Dewey
 i...@aghmed.fsnet.co.uk
 http://www.aghmed.fsnet.co.uk/home.html



[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Metafor: Strange Trim and Fill Outcome?

2014-05-26 Thread Viechtbauer Wolfgang (STAT)
From help(forest.rma):

pch -- plotting symbol to use for the observed effect sizes or outcomes. By 
default, a solid circle is used. Can also be a vector of values. See points for 
other options.

pch.fill -- plotting symbol to use for the effect sizes or outcomes filled in 
by the trim and fill method. By default, a circle is used. Only relevant when 
plotting an object created by the trimfill function.

The defaults are pch=19 and pch.fill=21. So, by default, a solid circle is used 
for the observed outcomes and an open circle is used for the outcomes that are 
filled in.

An example is shown here:

http://www.metafor-project.org/doku.php/plots:funnel_plot_with_trim_and_fill

From help(trimfill.rma.uni):

side -- either left or right, indicating on which side of the funnel plot 
the missing studies should be imputed. If left undefined, the side is chosen 
within the function depending on the results of Egger's regression test (see 
regtest for details on this test).

The argument is left undefined by default, so the side is chosen based on the 
results of the regression test (essentially, whether the slope is positive or 
negative). If you think the suppression occurred on the other side than the one 
that is chosen, specify the side via this argument.

Best,
Wolfgang 

From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of 
Verena Weinbir [vwein...@gmail.com]
Sent: Monday, May 26, 2014 1:15 PM
To: Michael Dewey
Cc: r-help
Subject: Re: [R] Metafor: Strange Trim and Fill Outcome?

thanks for your reply, Michael!

ad primary studies:
yup, I have a large set of studies: At the moment I consider 126 data sets
in my analysis.

ad interpretation:
thats an interesting information. But usually there should be found an
effect.

ad bit :-):
I am irritiated, because in the plots I have studied so far, I always found
that the observed studies are open circles and the additional mirrored
effects are black dots. In my case, it is the other way round.

Also, most of the mirrored circels appear in the right upper corner,
indicating, that there are studies missing in my data set, which have
smaller SDs (i.e. are more precise?) and higher effect sizes?

best,

Verena

On Mon, May 26, 2014 at 12:26 PM, Michael Dewey i...@aghmed.fsnet.co.ukwrote:

 At 09:34 26/05/2014, Verena Weinbir wrote:

 Hey guys,

 I have tested the metafor trim and fill function (y:SD, x:SMD)on my data
 set and yielded the following result:

 1. missing studies on the right: 34

 That seems a lot of missing studies unless you have a very large set of
 primary studies.

  2. open circles on the rights side appear to be the number of additional
 effects

 3. adjusted d would be higher than observed d.

 Implying that the mechanism is suppressing studies which found a large
 effect. This might happen if the dominant view is that there is no effect
 and so when people find one they worry about their results.

  Since normally, as I understand, those parameters are the other way round
 (black dots indicating missing studies on the left, which would reduce the
 effect size), I wonder:

 Is there a mistake I have done? Or, if this is an actual outcome how can I
 interpret this?  That its not a publication bias that influences my data
 set, but a lack of precision (studies missing that are precise -small SD-
 and have big SMD)?

 Sorry but that bit is not very clear to me.

  Many thanks in advance!

 Verena
__
R-help@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.


Re: [R] Metafor: Strange Trim and Fill Outcome?

2014-05-26 Thread Verena Weinbir
thanks for your reply, Wolfgang!

Regarding the dots/circle -problem I am relieved now :-)

Regarding the Trim and Fill outcome I don't really think that it's the
wrong side, I just dont know how to interpret the result.

regtest () reveals a negative z, which is not significant.
ranktest () reveals a negative tau, which is not significant.

Any ideas? :-)

best,

Verena


On Mon, May 26, 2014 at 2:00 PM, Viechtbauer Wolfgang (STAT) 
wolfgang.viechtba...@maastrichtuniversity.nl wrote:

 From help(forest.rma):

 pch -- plotting symbol to use for the observed effect sizes or outcomes.
 By default, a solid circle is used. Can also be a vector of values. See
 points for other options.

 pch.fill -- plotting symbol to use for the effect sizes or outcomes filled
 in by the trim and fill method. By default, a circle is used. Only relevant
 when plotting an object created by the trimfill function.

 The defaults are pch=19 and pch.fill=21. So, by default, a solid circle is
 used for the observed outcomes and an open circle is used for the outcomes
 that are filled in.

 An example is shown here:


 http://www.metafor-project.org/doku.php/plots:funnel_plot_with_trim_and_fill

 From help(trimfill.rma.uni):

 side -- either left or right, indicating on which side of the funnel
 plot the missing studies should be imputed. If left undefined, the side is
 chosen within the function depending on the results of Egger's regression
 test (see regtest for details on this test).

 The argument is left undefined by default, so the side is chosen based on
 the results of the regression test (essentially, whether the slope is
 positive or negative). If you think the suppression occurred on the other
 side than the one that is chosen, specify the side via this argument.

 Best,
 Wolfgang
 
 From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On
 Behalf Of Verena Weinbir [vwein...@gmail.com]
 Sent: Monday, May 26, 2014 1:15 PM
 To: Michael Dewey
 Cc: r-help
 Subject: Re: [R] Metafor: Strange Trim and Fill Outcome?

 thanks for your reply, Michael!

 ad primary studies:
 yup, I have a large set of studies: At the moment I consider 126 data sets
 in my analysis.

 ad interpretation:
 thats an interesting information. But usually there should be found an
 effect.

 ad bit :-):
 I am irritiated, because in the plots I have studied so far, I always found
 that the observed studies are open circles and the additional mirrored
 effects are black dots. In my case, it is the other way round.

 Also, most of the mirrored circels appear in the right upper corner,
 indicating, that there are studies missing in my data set, which have
 smaller SDs (i.e. are more precise?) and higher effect sizes?

 best,

 Verena

 On Mon, May 26, 2014 at 12:26 PM, Michael Dewey i...@aghmed.fsnet.co.uk
 wrote:

  At 09:34 26/05/2014, Verena Weinbir wrote:
 
  Hey guys,
 
  I have tested the metafor trim and fill function (y:SD, x:SMD)on my data
  set and yielded the following result:
 
  1. missing studies on the right: 34
 
  That seems a lot of missing studies unless you have a very large set of
  primary studies.
 
   2. open circles on the rights side appear to be the number of additional
  effects
 
  3. adjusted d would be higher than observed d.
 
  Implying that the mechanism is suppressing studies which found a large
  effect. This might happen if the dominant view is that there is no effect
  and so when people find one they worry about their results.
 
   Since normally, as I understand, those parameters are the other way
 round
  (black dots indicating missing studies on the left, which would reduce
 the
  effect size), I wonder:
 
  Is there a mistake I have done? Or, if this is an actual outcome how
 can I
  interpret this?  That its not a publication bias that influences my data
  set, but a lack of precision (studies missing that are precise -small
 SD-
  and have big SMD)?
 
  Sorry but that bit is not very clear to me.
 
   Many thanks in advance!
 
  Verena


[[alternative HTML version deleted]]

__
R-help@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.


[R] Metafor: forest plot for subset

2014-05-26 Thread Verena Weinbir
Hey,

I want to build a forest plot which states author and year for a subset of
studies.

But if I use this argument:

resultREML - rma(yi=yi, vi=vi, method = REML,
 data = subset(empa, task==x))
resultREML

forest(resultREML, , slab=paste(empa$author, empa$year,sep = ,))

I get the following error message:

Error in forest.rma(resultREML, slab = paste(EFempa$Autor,
EFempa$Jahreszahl,  :
  Number of outcomes does not correspond to the length of the slab argument.


When I use this method without the subset function it works and I get a
forest plot stating author and year - but of course for the whole data set,
not only for the subset x that I want.

Any idea how I can make the subset function work for a forest plot with
slab function ?

Thanks in advance!

Verena

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Metafor: forest plot for subset

2014-05-26 Thread Viechtbauer Wolfgang (STAT)
Pass 'slab' to the rma() function instead of the forest() function. Also, 
'slab' is evaluated in the data frame passed via the 'data' argument, so no 
need to use empa$... And there is a 'subset' argument for rma(). Might as well 
use it. This should do it:

resultREML - rma(yi=yi, vi=vi, method=REML, slab=paste(author, year, sep = 
,), data=empa, subset=task==x)
forest(resultREML)

Best,
Wolfgang

--   
Wolfgang Viechtbauer, Ph.D., Statistician   
Department of Psychiatry and Psychology   
School for Mental Health and Neuroscience   
Faculty of Health, Medicine, and Life Sciences   
Maastricht University, P.O. Box 616 (VIJV1)   
6200 MD Maastricht, The Netherlands   
+31 (43) 388-4170 | http://www.wvbauer.com   

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of Verena Weinbir
 Sent: Monday, May 26, 2014 18:57
 To: r-help
 Subject: [R] Metafor: forest plot for subset
 
 Hey,
 
 I want to build a forest plot which states author and year for a subset
 of
 studies.
 
 But if I use this argument:
 
 resultREML - rma(yi=yi, vi=vi, method = REML,
  data = subset(empa, task==x))
 resultREML
 
 forest(resultREML, , slab=paste(empa$author, empa$year,sep = ,))
 
 I get the following error message:
 
 Error in forest.rma(resultREML, slab = paste(EFempa$Autor,
 EFempa$Jahreszahl,  :
   Number of outcomes does not correspond to the length of the slab
 argument.
 
 
 When I use this method without the subset function it works and I get a
 forest plot stating author and year - but of course for the whole data
 set,
 not only for the subset x that I want.
 
 Any idea how I can make the subset function work for a forest plot with
 slab function ?
 
 Thanks in advance!
 
 Verena
 
   [[alternative HTML version deleted]]
 
 __
 R-help@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.

__
R-help@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.


Re: [R] Metafor: How to integrate effectsizes?

2014-05-22 Thread Verena Weinbir
Hello,

thank you very much for your replies. I am almost done :-) but theres one
study left, where I only have sample size (not group size),  mean values
and standarddeviations. Is there a way to compute cohens d from this data?

I thought it was correct to use measure=SMDH in the escalc () function to
compute cohens d? In your illustration, Wolfgang, you use SMD as measure -
now I am confused ;-)

Thank you very much in advance!

Best,
Verena


On Tue, May 6, 2014 at 7:14 PM, Michael Dewey i...@aghmed.fsnet.co.ukwrote:

 At 14:23 06/05/2014, Viechtbauer Wolfgang (STAT) wrote:

 Without the sample size of a study (i.e., either the group sizes or the
 total sample size), you cannot convert the p-value to a t-value or a
 t-value to a d-value. And for studies where you have the d-value but no
 sample size, you cannot compute the corresponding sampling variance. So,
 without additional information, you cannot include these studies. Maybe
 studies where a d-value is directly reported also report a CI for the
 d-value? Then the sampling variance can be back-calculated (since a 95% CI
 for d is typically computed with d +- 1.96 sqrt(vi), where vi is the
 sampling variance).


 Verena,
 What Wolfgang says is true of course but if you have _both_ the t value
 and the p value you can backcalculate the number of degrees of freedom and
 then if you are willing to assume equal arms you have the sample sizes.

 finddf - function(t, pval) {
helper - function(df) {res - pval - pt(t, df, lower.tail = FALSE);
 res}
res - uniroot(helper, interval = c(5, 1))
res
 }

 If you call finddf with the value of t and the _one-sided_ p-value (divide
 by 2 if two-sided) it should give you a return value which, if you look at
 the element of the list called root is its estimate of the degrees of
 freedom. If you get errors from uniroot the interval supplied in the call
 may need to be widened.

 I would suggest that when you have your final dataset it would be a really
 good idea to do some model checks using plot.influence to see whether the
 studies for which you have imputed values are fundamentally different for
 some reason. This will also check your calculations as a bonus.


  Best,
 Wolfgang

  -Original Message-
  From: Verena Weinbir [mailto:vwein...@gmail.com]
  Sent: Tuesday, May 06, 2014 15:09
  To: Michael Dewey
  Cc: Viechtbauer Wolfgang (STAT); r-help@r-project.org
  Subject: Re: [R] Metafor: How to integrate effectsizes?
 
  Thank you very much for your illustration, Wolfgang! It helped me a
  lot.  And also thank you for the package-hint, Michael!

 
  Now, I have re-checked the respective studies, and there still are a
  couple of studies left, only stating cohens d, and the respective
 t-value
  and p-value - sample and group sizes are not addressed (its data from an
  older meta-analysis). Is there a way to embed these studies in my
 sample?
  Wolfgangs illustration addresses only cases in which group sizes are
  stated, if I understand you correctly...
 
  Many thanks in advance,
 
  Verena
 
  On Sat, Apr 26, 2014 at 1:38 PM, Michael Dewey i...@aghmed.fsnet.co.uk
 
  wrote:
  At 20:34 25/04/2014, Viechtbauer Wolfgang (STAT) wrote:
  If you know the d-value and the corresponding group sizes for a study,
  then it's possible to add that study to the rest of the dataset. Also,
 if
  you only know the test statistic from an independent samples t-test (or
  only the p-value corresponding to that test), it's possible to back-
  compute what the standardized mean difference is.
 
  I added an illustration of this to the metafor package website:
 
  http://www.metafor-project.org/doku.php/tips:assembling_data_smd
 
  Verena might also like to look at the compute.es package available from
  CRAN to see whether any of the conversions programmed there do the job.
 
 
  Best,
  Wolfgang
 
  --
  Wolfgang Viechtbauer, Ph.D., Statistician
  Department of Psychiatry and Psychology
  School for Mental Health and Neuroscience
  Faculty of Health, Medicine, and Life Sciences
  Maastricht University, P.O. Box 616 (VIJV1)
  6200 MD Maastricht, The Netherlands
  +31 (43) 388-4170Â | http://www.wvbauer.com

 
   -Original Message-
   From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
  project.org]
   On Behalf Of Michael Dewey
   Sent: Friday, April 25, 2014 16:23
   To: Verena Weinbir
   Cc: r-help@r-project.org
   Subject: Re: [R] Metafor: How to integrate effectsizes?
  
   At 12:33 25/04/2014, you wrote:
   Thank you very much for your reply and the book recommendation,
  Michael.
   
   Yes, I mean Cohen's d - sorry for the typo :-)
   
   Just to make this sure for me: There is no
   possibility to integrate stated Cohens' ds in an
   R-Metaanalysis (or a MA at all), if there is no
   further information traceable regarding SE or the like?
  
   If there is really no other information like
   sample sizes, significance level, value of some
   significance test then you would have

Re: [R] Metafor: How to integrate effectsizes?

2014-05-06 Thread Viechtbauer Wolfgang (STAT)
Without the sample size of a study (i.e., either the group sizes or the total 
sample size), you cannot convert the p-value to a t-value or a t-value to a 
d-value. And for studies where you have the d-value but no sample size, you 
cannot compute the corresponding sampling variance. So, without additional 
information, you cannot include these studies. Maybe studies where a d-value is 
directly reported also report a CI for the d-value? Then the sampling variance 
can be back-calculated (since a 95% CI for d is typically computed with d +- 
1.96 sqrt(vi), where vi is the sampling variance).

Best,
Wolfgang

 -Original Message-
 From: Verena Weinbir [mailto:vwein...@gmail.com]
 Sent: Tuesday, May 06, 2014 15:09
 To: Michael Dewey
 Cc: Viechtbauer Wolfgang (STAT); r-help@r-project.org
 Subject: Re: [R] Metafor: How to integrate effectsizes?
 
 Thank you very much for your illustration, Wolfgang! It helped me a
 lot.  And also thank you for the package-hint, Michael!
 
 Now, I have re-checked the respective studies, and there still are a
 couple of studies left, only stating cohens d, and the respective t-value
 and p-value - sample and group sizes are not addressed (its data from an
 older meta-analysis). Is there a way to embed these studies in my sample?
 Wolfgangs illustration addresses only cases in which group sizes are
 stated, if I understand you correctly...
 
 Many thanks in advance,
 
 Verena
 
 On Sat, Apr 26, 2014 at 1:38 PM, Michael Dewey i...@aghmed.fsnet.co.uk
 wrote:
 At 20:34 25/04/2014, Viechtbauer Wolfgang (STAT) wrote:
 If you know the d-value and the corresponding group sizes for a study,
 then it's possible to add that study to the rest of the dataset. Also, if
 you only know the test statistic from an independent samples t-test (or
 only the p-value corresponding to that test), it's possible to back-
 compute what the standardized mean difference is.
 
 I added an illustration of this to the metafor package website:
 
 http://www.metafor-project.org/doku.php/tips:assembling_data_smd
 
 Verena might also like to look at the compute.es package available from
 CRAN to see whether any of the conversions programmed there do the job.
 
 
 Best,
 Wolfgang
 
 --
 Wolfgang Viechtbauer, Ph.D., Statistician
 Department of Psychiatry and Psychology
 School for Mental Health and Neuroscience
 Faculty of Health, Medicine, and Life Sciences
 Maastricht University, P.O. Box 616 (VIJV1)
 6200 MD Maastricht, The Netherlands
 +31 (43) 388-4170 | http://www.wvbauer.com
 
  -Original Message-
  From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
 project.org]
  On Behalf Of Michael Dewey
  Sent: Friday, April 25, 2014 16:23
  To: Verena Weinbir
  Cc: r-help@r-project.org
  Subject: Re: [R] Metafor: How to integrate effectsizes?
 
  At 12:33 25/04/2014, you wrote:
  Thank you very much for your reply and the book recommendation,
 Michael.
  
  Yes, I mean Cohen's d - sorry for the typo :-)
  
  Just to make this sure for me: There is no
  possibility to integrate stated Cohens' ds in an
  R-Metaanalysis (or a MA at all), if there is no
  further information traceable regarding SE or the like?
 
  If there is really no other information like
  sample sizes, significance level, value of some
  significance test then you would have to impute a
  value from somewhere. That would seem a last resort.
 
  I have cc'ed this back to the list, please keep
  it on the list so others may benefit and contribute.
 
 
  best regards,
  
  Verena
  
  
  On Fri, Apr 25, 2014 at 1:21 PM, Michael Dewey
  mailto:i...@aghmed.fsnet.co.uki...@aghmed.fsnet.co.uk wrote:
  At 13:15 24/04/2014, Verena Weinbir wrote:
  Hello!
  
  I am using the metafor package for my master's thesis as an R-newbie.
  While
  calculating effectsizes from my dataset (mean values and
  standarddeviations) using escalc shouldn't be a problem (I hope ;-
 )),
  I
  wonder how I could at this point integrate additional studies, which
  only
  state conhens d (no information about mean value and sds available),
 to
  calculate an overall analysis. Â I would be very grateful for your
  support!
  
  
  You mean Cohen's d I think.
  
  You will need some more information to enable
  you to calculate its standard error. Have a look at Rosenthal's
 chapter
  in
  @book{cooper94,
  Â  Â author = {Cooper, H and Hedges, L V},
  Â  Â title = {A handbook of research synthesis},
  Â  Â year = {1994},
  Â  Â publisher = {Russell Sage},
  Â  Â address = {New York},
  Â  Â keywords = {meta-analysis}
  }
  (There is an updated edition)
  This gives you more information about converting
  effect sizes and extracting them from unpromising beginnings.
  
  It often requires some ingenuity to get the
  information you need so have a go and then get
  back here with more details if you run into problems
  
  
  Best regards,
  
  Verena
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman

Re: [R] Metafor: How to integrate effectsizes?

2014-05-06 Thread Verena Weinbir
Thank you very much for your illustration, Wolfgang! It helped me a lot.
And also thank you for the package-hint, Michael!

Now, I have re-checked the respective studies, and there still are a couple
of studies left, only stating cohens d, and the respective t-value and
p-value - sample and group sizes are not addressed (its data from an older
meta-analysis). Is there a way to embed these studies in my sample?
Wolfgangs illustration addresses only cases in which group sizes are
stated, if I understand you correctly...

Many thanks in advance,

Verena


On Sat, Apr 26, 2014 at 1:38 PM, Michael Dewey i...@aghmed.fsnet.co.ukwrote:

 At 20:34 25/04/2014, Viechtbauer Wolfgang (STAT) wrote:

 If you know the d-value and the corresponding group sizes for a study,
 then it's possible to add that study to the rest of the dataset. Also, if
 you only know the test statistic from an independent samples t-test (or
 only the p-value corresponding to that test), it's possible to back-compute
 what the standardized mean difference is.

 I added an illustration of this to the metafor package website:

 http://www.metafor-project.org/doku.php/tips:assembling_data_smd


 Verena might also like to look at the compute.es package available from
 CRAN to see whether any of the conversions programmed there do the job.



  Best,
 Wolfgang

 --
 Wolfgang Viechtbauer, Ph.D., Statistician
 Department of Psychiatry and Psychology
 School for Mental Health and Neuroscience
 Faculty of Health, Medicine, and Life Sciences
 Maastricht University, P.O. Box 616 (VIJV1)
 6200 MD Maastricht, The Netherlands
 +31 (43) 388-4170 | http://www.wvbauer.com

  -Original Message-
  From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org
 ]
  On Behalf Of Michael Dewey
  Sent: Friday, April 25, 2014 16:23
  To: Verena Weinbir
  Cc: r-help@r-project.org
  Subject: Re: [R] Metafor: How to integrate effectsizes?
 
  At 12:33 25/04/2014, you wrote:
  Thank you very much for your reply and the book recommendation,
 Michael.
  
  Yes, I mean Cohen's d - sorry for the typo :-)
  
  Just to make this sure for me: There is no
  possibility to integrate stated Cohens' ds in an
  R-Metaanalysis (or a MA at all), if there is no
  further information traceable regarding SE or the like?
 
  If there is really no other information like
  sample sizes, significance level, value of some
  significance test then you would have to impute a
  value from somewhere. That would seem a last resort.
 
  I have cc'ed this back to the list, please keep
  it on the list so others may benefit and contribute.
 
 
  best regards,
  
  Verena
  
  
  On Fri, Apr 25, 2014 at 1:21 PM, Michael Dewey
  mailto:i...@aghmed.fsnet.co.uki...@aghmed.fsnet.co.uk wrote:
  At 13:15 24/04/2014, Verena Weinbir wrote:
  Hello!
  
  I am using the metafor package for my master's thesis as an R-newbie.
  While
  calculating effectsizes from my dataset (mean values and
  standarddeviations) using escalc shouldn't be a problem (I hope ;-)),
  I
  wonder how I could at this point integrate additional studies, which
  only
  state conhens d (no information about mean value and sds available), to
  calculate an overall analysis. Â I would be very grateful for your
  support!
  
  
  You mean Cohen's d I think.
  
  You will need some more information to enable
  you to calculate its standard error. Have a look at Rosenthal's chapter
  in
  @book{cooper94,
  Â  Â author = {Cooper, H and Hedges, L V},
  Â  Â title = {A handbook of research synthesis},
  Â  Â year = {1994},
  Â  Â publisher = {Russell Sage},
  Â  Â address = {New York},
  Â  Â keywords = {meta-analysis}
  }
  (There is an updated edition)
  This gives you more information about converting
  effect sizes and extracting them from unpromising beginnings.
  
  It often requires some ingenuity to get the
  information you need so have a go and then get
  back here with more details if you run into problems
  
  
  Best regards,
  
  Verena


 Michael Dewey
 i...@aghmed.fsnet.co.uk
 http://www.aghmed.fsnet.co.uk/home.html



[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Metafor: How to integrate effectsizes?

2014-05-06 Thread Michael Dewey

At 14:23 06/05/2014, Viechtbauer Wolfgang (STAT) wrote:
Without the sample size of a study (i.e., either 
the group sizes or the total sample size), you 
cannot convert the p-value to a t-value or a 
t-value to a d-value. And for studies where you 
have the d-value but no sample size, you cannot 
compute the corresponding sampling variance. So, 
without additional information, you cannot 
include these studies. Maybe studies where a 
d-value is directly reported also report a CI 
for the d-value? Then the sampling variance can 
be back-calculated (since a 95% CI for d is 
typically computed with d +- 1.96 sqrt(vi), where vi is the sampling variance).


Verena,
What Wolfgang says is true of course but if you 
have _both_ the t value and the p value you can 
backcalculate the number of degrees of freedom 
and then if you are willing to assume equal arms you have the sample sizes.


finddf - function(t, pval) {
   helper - function(df) {res - pval - pt(t, df, lower.tail = FALSE); res}
   res - uniroot(helper, interval = c(5, 1))
   res
}

If you call finddf with the value of t and the 
_one-sided_ p-value (divide by 2 if two-sided) it 
should give you a return value which, if you look 
at the element of the list called root is its 
estimate of the degrees of freedom. If you get 
errors from uniroot the interval supplied in the call may need to be widened.


I would suggest that when you have your final 
dataset it would be a really good idea to do some 
model checks using plot.influence to see whether 
the studies for which you have imputed values are 
fundamentally different for some reason. This 
will also check your calculations as a bonus.




Best,
Wolfgang

 -Original Message-
 From: Verena Weinbir [mailto:vwein...@gmail.com]
 Sent: Tuesday, May 06, 2014 15:09
 To: Michael Dewey
 Cc: Viechtbauer Wolfgang (STAT); r-help@r-project.org
 Subject: Re: [R] Metafor: How to integrate effectsizes?

 Thank you very much for your illustration, Wolfgang! It helped me a
 lot.  And also thank you for the package-hint, Michael!

 Now, I have re-checked the respective studies, and there still are a
 couple of studies left, only stating cohens d, and the respective t-value
 and p-value - sample and group sizes are not addressed (its data from an
 older meta-analysis). Is there a way to embed these studies in my sample?
 Wolfgangs illustration addresses only cases in which group sizes are
 stated, if I understand you correctly...

 Many thanks in advance,

 Verena

 On Sat, Apr 26, 2014 at 1:38 PM, Michael Dewey i...@aghmed.fsnet.co.uk
 wrote:
 At 20:34 25/04/2014, Viechtbauer Wolfgang (STAT) wrote:
 If you know the d-value and the corresponding group sizes for a study,
 then it's possible to add that study to the rest of the dataset. Also, if
 you only know the test statistic from an independent samples t-test (or
 only the p-value corresponding to that test), it's possible to back-
 compute what the standardized mean difference is.

 I added an illustration of this to the metafor package website:

 http://www.metafor-project.org/doku.php/tips:assembling_data_smd

 Verena might also like to look at the compute.es package available from
 CRAN to see whether any of the conversions programmed there do the job.


 Best,
 Wolfgang

 --
 Wolfgang Viechtbauer, Ph.D., Statistician
 Department of Psychiatry and Psychology
 School for Mental Health and Neuroscience
 Faculty of Health, Medicine, and Life Sciences
 Maastricht University, P.O. Box 616 (VIJV1)
 6200 MD Maastricht, The Netherlands
 +31 (43) 388-4170Â | http://www.wvbauer.com

  -Original Message-
  From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
 project.org]
  On Behalf Of Michael Dewey
  Sent: Friday, April 25, 2014 16:23
  To: Verena Weinbir
  Cc: r-help@r-project.org
  Subject: Re: [R] Metafor: How to integrate effectsizes?
 
  At 12:33 25/04/2014, you wrote:
  Thank you very much for your reply and the book recommendation,
 Michael.
  
  Yes, I mean Cohen's d - sorry for the typo :-)
  
  Just to make this sure for me: There is no
  possibility to integrate stated Cohens' ds in an
  R-Metaanalysis (or a MA at all), if there is no
  further information traceable regarding SE or the like?
 
  If there is really no other information like
  sample sizes, significance level, value of some
  significance test then you would have to impute a
  value from somewhere. That would seem a last resort.
 
  I have cc'ed this back to the list, please keep
  it on the list so others may benefit and contribute.
 
 
  best regards,
  
  Verena
  
  
  On Fri, Apr 25, 2014 at 1:21 PM, Michael Dewey
  mailto:i...@aghmed.fsnet.co.uki...@aghmed.fsnet.co.uk wrote:
  At 13:15 24/04/2014, Verena Weinbir wrote:
  Hello!
  
  I am using the metafor package for my master's thesis as an R-newbie.
  While
  calculating effectsizes from my dataset (mean values and
  standarddeviations) using escalc shouldn't be a problem (I hope ;-
 )),
  I
  wonder how I

Re: [R] Metafor: How to integrate effectsizes?

2014-04-26 Thread Michael Dewey

At 20:34 25/04/2014, Viechtbauer Wolfgang (STAT) wrote:
If you know the d-value and the corresponding 
group sizes for a study, then it's possible to 
add that study to the rest of the dataset. Also, 
if you only know the test statistic from an 
independent samples t-test (or only the p-value 
corresponding to that test), it's possible to 
back-compute what the standardized mean difference is.


I added an illustration of this to the metafor package website:

http://www.metafor-project.org/doku.php/tips:assembling_data_smd


Verena might also like to look at the compute.es 
package available from CRAN to see whether any of 
the conversions programmed there do the job.




Best,
Wolfgang

--
Wolfgang Viechtbauer, Ph.D., Statistician
Department of Psychiatry and Psychology
School for Mental Health and Neuroscience
Faculty of Health, Medicine, and Life Sciences
Maastricht University, P.O. Box 616 (VIJV1)
6200 MD Maastricht, The Netherlands
+31 (43) 388-4170 | http://www.wvbauer.com

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of Michael Dewey
 Sent: Friday, April 25, 2014 16:23
 To: Verena Weinbir
 Cc: r-help@r-project.org
 Subject: Re: [R] Metafor: How to integrate effectsizes?

 At 12:33 25/04/2014, you wrote:
 Thank you very much for your reply and the book recommendation, Michael.
 
 Yes, I mean Cohen's d - sorry for the typo :-)
 
 Just to make this sure for me: There is no
 possibility to integrate stated Cohens' ds in an
 R-Metaanalysis (or a MA at all), if there is no
 further information traceable regarding SE or the like?

 If there is really no other information like
 sample sizes, significance level, value of some
 significance test then you would have to impute a
 value from somewhere. That would seem a last resort.

 I have cc'ed this back to the list, please keep
 it on the list so others may benefit and contribute.


 best regards,
 
 Verena
 
 
 On Fri, Apr 25, 2014 at 1:21 PM, Michael Dewey
 mailto:i...@aghmed.fsnet.co.uki...@aghmed.fsnet.co.uk wrote:
 At 13:15 24/04/2014, Verena Weinbir wrote:
 Hello!
 
 I am using the metafor package for my master's thesis as an R-newbie.
 While
 calculating effectsizes from my dataset (mean values and
 standarddeviations) using escalc shouldn't be a problem (I hope ;-)),
 I
 wonder how I could at this point integrate additional studies, which
 only
 state conhens d (no information about mean value and sds available), to
 calculate an overall analysis. Â I would be very grateful for your
 support!
 
 
 You mean Cohen's d I think.
 
 You will need some more information to enable
 you to calculate its standard error. Have a look at Rosenthal's chapter
 in
 @book{cooper94,
 Â  Â author = {Cooper, H and Hedges, L V},
 Â  Â title = {A handbook of research synthesis},
 Â  Â year = {1994},
 Â  Â publisher = {Russell Sage},
 Â  Â address = {New York},
 Â  Â keywords = {meta-analysis}
 }
 (There is an updated edition)
 This gives you more information about converting
 effect sizes and extracting them from unpromising beginnings.
 
 It often requires some ingenuity to get the
 information you need so have a go and then get
 back here with more details if you run into problems
 
 
 Best regards,
 
 Verena


Michael Dewey
i...@aghmed.fsnet.co.uk
http://www.aghmed.fsnet.co.uk/home.html

__
R-help@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.


Re: [R] Metafor: How to integrate effectsizes?

2014-04-25 Thread Michael Dewey

At 13:15 24/04/2014, Verena Weinbir wrote:

Hello!

I am using the metafor package for my master's thesis as an R-newbie. While
calculating effectsizes from my dataset (mean values and
standarddeviations) using escalc shouldn't be a problem (I hope ;-)), I
wonder how I could at this point integrate additional studies, which only
state conhens d (no information about mean value and sds available), to
calculate an overall analysis.  I would be very grateful for your support!


You mean Cohen's d I think.

You will need some more information to enable you to calculate its 
standard error. Have a look at Rosenthal's chapter in

@book{cooper94,
   author = {Cooper, H and Hedges, L V},
   title = {A handbook of research synthesis},
   year = {1994},
   publisher = {Russell Sage},
   address = {New York},
   keywords = {meta-analysis}
}
(There is an updated edition)
This gives you more information about converting effect sizes and 
extracting them from unpromising beginnings.


It often requires some ingenuity to get the information you need so 
have a go and then get back here with more details if you run into problems




Best regards,

Verena

[[alternative HTML version deleted]]


Michael Dewey
i...@aghmed.fsnet.co.uk
http://www.aghmed.fsnet.co.uk/home.html

__
R-help@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.


Re: [R] Metafor: How to integrate effectsizes?

2014-04-25 Thread Michael Dewey

At 12:33 25/04/2014, you wrote:

Thank you very much for your reply and the book recommendation, Michael.

Yes, I mean Cohen's d - sorry for the typo :-)

Just to make this sure for me: There is no 
possibility to integrate stated Cohens' ds in an 
R-Metaanalysis (or a MA at all), if there is no 
further information traceable regarding SE or the like?


If there is really no other information like 
sample sizes, significance level, value of some 
significance test then you would have to impute a 
value from somewhere. That would seem a last resort.


I have cc'ed this back to the list, please keep 
it on the list so others may benefit and contribute.




best regards,

Verena


On Fri, Apr 25, 2014 at 1:21 PM, Michael Dewey 
mailto:i...@aghmed.fsnet.co.uki...@aghmed.fsnet.co.uk wrote:

At 13:15 24/04/2014, Verena Weinbir wrote:
Hello!

I am using the metafor package for my master's thesis as an R-newbie. While
calculating effectsizes from my dataset (mean values and
standarddeviations) using escalc shouldn't be a problem (I hope ;-)), I
wonder how I could at this point integrate additional studies, which only
state conhens d (no information about mean value and sds available), to
calculate an overall analysis. Â I would be very grateful for your support!


You mean Cohen's d I think.

You will need some more information to enable 
you to calculate its standard error. Have a look at Rosenthal's chapter in

@book{cooper94,
   author = {Cooper, H and Hedges, L V},
   title = {A handbook of research synthesis},
   year = {1994},
   publisher = {Russell Sage},
   address = {New York},
   keywords = {meta-analysis}
}
(There is an updated edition)
This gives you more information about converting 
effect sizes and extracting them from unpromising beginnings.


It often requires some ingenuity to get the 
information you need so have a go and then get 
back here with more details if you run into problems



Best regards,

Verena

        [[alternative HTML version deleted]]


Michael Dewey
mailto:i...@aghmed.fsnet.co.uki...@aghmed.fsnet.co.uk
http://www.aghmed.fsnet.co.uk/home.html



Michael Dewey
i...@aghmed.fsnet.co.uk
http://www.aghmed.fsnet.co.uk/home.html

__
R-help@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.


Re: [R] Metafor: How to integrate effectsizes?

2014-04-25 Thread Viechtbauer Wolfgang (STAT)
If you know the d-value and the corresponding group sizes for a study, then 
it's possible to add that study to the rest of the dataset. Also, if you only 
know the test statistic from an independent samples t-test (or only the p-value 
corresponding to that test), it's possible to back-compute what the 
standardized mean difference is.

I added an illustration of this to the metafor package website:

http://www.metafor-project.org/doku.php/tips:assembling_data_smd

Best,
Wolfgang

--   
Wolfgang Viechtbauer, Ph.D., Statistician   
Department of Psychiatry and Psychology   
School for Mental Health and Neuroscience   
Faculty of Health, Medicine, and Life Sciences   
Maastricht University, P.O. Box 616 (VIJV1)   
6200 MD Maastricht, The Netherlands   
+31 (43) 388-4170 | http://www.wvbauer.com   

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of Michael Dewey
 Sent: Friday, April 25, 2014 16:23
 To: Verena Weinbir
 Cc: r-help@r-project.org
 Subject: Re: [R] Metafor: How to integrate effectsizes?
 
 At 12:33 25/04/2014, you wrote:
 Thank you very much for your reply and the book recommendation, Michael.
 
 Yes, I mean Cohen's d - sorry for the typo :-)
 
 Just to make this sure for me: There is no
 possibility to integrate stated Cohens' ds in an
 R-Metaanalysis (or a MA at all), if there is no
 further information traceable regarding SE or the like?
 
 If there is really no other information like
 sample sizes, significance level, value of some
 significance test then you would have to impute a
 value from somewhere. That would seem a last resort.
 
 I have cc'ed this back to the list, please keep
 it on the list so others may benefit and contribute.
 
 
 best regards,
 
 Verena
 
 
 On Fri, Apr 25, 2014 at 1:21 PM, Michael Dewey
 mailto:i...@aghmed.fsnet.co.uki...@aghmed.fsnet.co.uk wrote:
 At 13:15 24/04/2014, Verena Weinbir wrote:
 Hello!
 
 I am using the metafor package for my master's thesis as an R-newbie.
 While
 calculating effectsizes from my dataset (mean values and
 standarddeviations) using escalc shouldn't be a problem (I hope ;-)),
 I
 wonder how I could at this point integrate additional studies, which
 only
 state conhens d (no information about mean value and sds available), to
 calculate an overall analysis. Â I would be very grateful for your
 support!
 
 
 You mean Cohen's d I think.
 
 You will need some more information to enable
 you to calculate its standard error. Have a look at Rosenthal's chapter
 in
 @book{cooper94,
 Â  Â author = {Cooper, H and Hedges, L V},
 Â  Â title = {A handbook of research synthesis},
 Â  Â year = {1994},
 Â  Â publisher = {Russell Sage},
 Â  Â address = {New York},
 Â  Â keywords = {meta-analysis}
 }
 (There is an updated edition)
 This gives you more information about converting
 effect sizes and extracting them from unpromising beginnings.
 
 It often requires some ingenuity to get the
 information you need so have a go and then get
 back here with more details if you run into problems
 
 
 Best regards,
 
 Verena

__
R-help@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.


Re: [R] metafor - rstudent(res) - omitted rows

2014-04-24 Thread Michael Dewey

At 11:56 22/04/2014, Dipl. Kfm Dominik Wagner MSc; MSc wrote:

Dear all,

I am quite new to R. Now my following easy question.

I use metafor and performed an outlier test with rstudent(res).
This is resulting in 1000 rows of 1578 and 578 omitted rows (starting with
row 598).


   1. How can I display all 1578 rows in R-studio? Because in the
   standardized residual plot it starts with study 1 (see attachment). In
   R-studio with row 598.
   2. How can I just plot the standardized residuals with manipulated
   x-axis to see every single study?


I cannot help with your Rstudio probelm as I do not use it but as far 
as your plotting question is concerned:


1 - do you really want to see all of the residuals? Why not just keep 
the ones outside the range -2 to +2 which you might then need to study further
2 - the pictures would probably be clearer if you identify and do not 
print out the two studies with r very close to -1 as they are 
compressing everything else

3 - hollow circles are often a good idea when you have overprinting.





Thank you very much for your help.

Cordially

Dominik

--

_


*Dipl.-Kfm. Dominik Wagner MSc. MSc.*

Content-Type: application/pdf; name=Rplot.pdf
Content-Disposition: attachment; filename=Rplot.pdf
X-Attachment-Id: f_hub2q8dv0


Michael Dewey
i...@aghmed.fsnet.co.uk
http://www.aghmed.fsnet.co.uk/home.html

__
R-help@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.


[R] Metafor: How to integrate effectsizes?

2014-04-24 Thread Verena Weinbir
Hello!

I am using the metafor package for my master's thesis as an R-newbie. While
calculating effectsizes from my dataset (mean values and
standarddeviations) using escalc shouldn't be a problem (I hope ;-)), I
wonder how I could at this point integrate additional studies, which only
state conhens d (no information about mean value and sds available), to
calculate an overall analysis.  I would be very grateful for your support!

Best regards,

Verena

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] metafor - rstudent(res) - omitted rows

2014-04-22 Thread Viechtbauer Wolfgang (STAT)
I think this may help:

http://www.metafor-project.org/doku.php/tips:handling_missing_data

I am not sure I understand your second question. All studies are shown (for 
which the standardized residual can be computed), but since there are so many 
studies, these plots are not really all that helpful. If you only want to plot 
the standardized residuals, then you could start with:

options(na.action = na.pass)
sav - rstandard(res)
plot(sav$slab, sav$z, pch=19, cex=.4, type=o)

and just start tweaking this. You will have to reduce the size of the axis 
annotations (look into cex.axis), probably make them vertically aligned (las), 
and stretch that plot very wide if you want to make out individual points. Look 
into help(par) for more details cex.axis and las, and help(Devices) for setting 
up a much wider plot.

Best,
Wolfgang

--   
Wolfgang Viechtbauer, Ph.D., Statistician   
Department of Psychiatry and Psychology   
School for Mental Health and Neuroscience   
Faculty of Health, Medicine, and Life Sciences   
Maastricht University, P.O. Box 616 (VIJV1)   
6200 MD Maastricht, The Netherlands   
+31 (43) 388-4170 | http://www.wvbauer.com   


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of Dipl. Kfm Dominik Wagner MSc; MSc
 Sent: Tuesday, April 22, 2014 12:56
 To: r-help@r-project.org
 Subject: [R] metafor - rstudent(res) - omitted rows
 
 Dear all,
 
 I am quite new to R. Now my following easy question.
 
 I use metafor and performed an outlier test with rstudent(res).
 This is resulting in 1000 rows of 1578 and 578 omitted rows (starting
 with
 row 598).
 
 
1. How can I display all 1578 rows in R-studio? Because in the
standardized residual plot it starts with study 1 (see attachment). In
R-studio with row 598.
2. How can I just plot the standardized residuals with manipulated
x-axis to see every single study?
 
 
 Thank you very much for your help.
 
 Cordially
 
 Dominik
 
 --
 
 _
 
 
 *Dipl.-Kfm. Dominik Wagner MSc. MSc.*
__
R-help@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.


Re: [R] {metafor} variance explaination for paired pre-test/posttest

2014-04-08 Thread Viechtbauer Wolfgang (STAT)
The standardized mean change using 'change score standardization' is described 
in this article:

Gibbons, R. D., Hedeker, D. R.,  Davis, J. M. (1993). Estimation of effect 
size from a series of experiments involving paired comparisons. Journal of 
Educational Statistics, 18(3), 271-279.

For a comparison of the standardized mean change using change versus raw score 
standardization, see:

Morris, S. B.,  DeShon, R. P. (2002). Combining effect size estimates in 
meta-analysis with repeated measures and independent-groups designs. 
Psychological Methods, 7(1), 105-125.

Viechtbauer, W. (2007). Approximate confidence intervals for standardized 
effect sizes in the two-independent and two-dependent samples design. Journal 
of Educational and Behavioral Statistics, 32(1), 39-60.

These articles also provide equations for the sampling variance of the 
standardized mean change. The equation 1/ni + yi^2/(2*ni) is the estimate based 
on the asymptotic variance of the standardized mean change using change score 
standardization. 

Best,
Wolfgang

--   
Wolfgang Viechtbauer, Ph.D., Statistician   
Department of Psychiatry and Psychology   
School for Mental Health and Neuroscience   
Faculty of Health, Medicine, and Life Sciences   
Maastricht University, P.O. Box 616 (VIJV1)   
6200 MD Maastricht, The Netherlands   
+31 (43) 388-4170 | http://www.wvbauer.com   

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of John Williams
 Sent: Tuesday, April 08, 2014 02:30
 To: r-help@r-project.org
 Subject: [R] {metafor} variance explaination for paired pre-test/posttest
 
 In a previous post
 https://stat.ethz.ch/pipermail/r-help/2012-April/308946.html
 https://stat.ethz.ch/pipermail/r-help/2012-April/308946.html  , the
 following calculation was given for imputing the variance of change
 scores
 for paired studies:
 
 // begin quote
 
 2) Often, the dependent variable is not the same in each study. Then you
 will have to resort to a standardized outcome measure. There are two
 options:
 
 a) standardization based on the change score standard deviation
 
 Then yi = (m1i - m2i) / sdi with sampling variance vi = 1/ni + yi^2 /
 (2*ni).
 
 // end quote
 
 I used the sampling variance equation above in a paper that is being
 reviewed by a coauthor, who is a biostatistician.
 
 He commented that he has never seen this equation for variance before,
 and
 it looks strange to him. To put my knowledge into perspective, I am an
 undergraduate taking my first statistics course. I imputed the t-
 statistic
 from two-sided p-values reported in the paper, and used that to get the
 sdi
 (as in the previous post).
 
 I consulted the Cochrane Handbook and The Handbook of Research Syntheses
 and
 Meta-analysis 2nd Ed (Cooper, Hedges, Valentine 2009) and couldn't find
 that
 equation anywhere.
 
 Would Prof. Viechtbauer, or anyone else knowledgeable, mind explaining
 the
 sample variance above? I need to be able to defend my choice of equation.
 Since it's the only method that I found that doesn't rely on a
 correlation
 coefficient (which are not included in the papers), I'd like to be able
 to
 justify it and not redo calculations for 23 studies if possible.
 
 Thank you very much,
 
 John
 
 
 John Williams
 ALB Candidate, Harvard University (Expected May 2014)
 johnwilli...@fas.harvard.edu
 jawilliam...@gmail.com

__
R-help@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.


Re: [R] {metafor} variance explaination for paired pre-test/posttest

2014-04-08 Thread John Williams
Prof. Viechtbauer, thanks for the articles. I appreciate your help.

Yours,

John 
 
 
John Williams 
ALB Candidate, Harvard University (Expected May 2014) 
johnwilli...@fas.harvard.edu
jawilliam...@gmail.com



--
View this message in context: 
http://r.789695.n4.nabble.com/metafor-variance-explaination-for-paired-pre-test-posttest-tp4688365p4688382.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.


[R] {metafor} variance explaination for paired pre-test/posttest

2014-04-07 Thread John Williams
In a previous post
https://stat.ethz.ch/pipermail/r-help/2012-April/308946.html
https://stat.ethz.ch/pipermail/r-help/2012-April/308946.html  , the
following calculation was given for imputing the variance of change scores
for paired studies:

// begin quote

2) Often, the dependent variable is not the same in each study. Then you
will have to resort to a standardized outcome measure. There are two
options:

a) standardization based on the change score standard deviation

Then yi = (m1i - m2i) / sdi with sampling variance vi = 1/ni + yi^2 /
(2*ni).

// end quote

I used the sampling variance equation above in a paper that is being
reviewed by a coauthor, who is a biostatistician. 

He commented that he has never seen this equation for variance before, and
it looks strange to him. To put my knowledge into perspective, I am an
undergraduate taking my first statistics course. I imputed the t-statistic
from two-sided p-values reported in the paper, and used that to get the sdi
(as in the previous post). 

I consulted the Cochrane Handbook and The Handbook of Research Syntheses and
Meta-analysis 2nd Ed (Cooper, Hedges, Valentine 2009) and couldn't find that
equation anywhere. 

Would Prof. Viechtbauer, or anyone else knowledgeable, mind explaining the
sample variance above? I need to be able to defend my choice of equation.
Since it's the only method that I found that doesn't rely on a correlation
coefficient (which are not included in the papers), I'd like to be able to
justify it and not redo calculations for 23 studies if possible.

Thank you very much,

John


John Williams
ALB Candidate, Harvard University (Expected May 2014)
johnwilli...@fas.harvard.edu
jawilliam...@gmail.com



--
View this message in context: 
http://r.789695.n4.nabble.com/metafor-variance-explaination-for-paired-pre-test-posttest-tp4688365.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.


[R] metafor combining escalc effect-sizes

2014-03-30 Thread Purssell, Ed

Dear All

I have a question about combining effect sizes generated by escalc in metafor.  
I realise these may be stupid things to do; but they are deliberately so to 
explain what I mean - I don't intend doing this!


I have 3 studies; each of which has a different measure of effect/presents the 
data differently, so I use escalc to calculate the effect size of each and 
combine them into a data-frame:

es1-escalc(measure=MD, m1i=10 , m2i=5 , n1i=12 , n2i=12, sd1i=2, sd2i=2)
es2-escalc(measure=RR, ai=10 , bi=5 , ci=12 , di=12)
es3-escalc(measure=RR, ai=10 , ci=5 , n1i=15 , n2i=12)
es4-rbind(es1, es2, es3) # combines the 3 effect sizes into a data frame

attach(es4) # makes the data frame available to R

es5-rma(yi, vi, data=es4) # running the meta analysis here gives the error 
message

Error in rma(yi, vi, data = es4) :
  Length of yi and ni vectors are not the same.

But if I save this as a .csv and open it in R using read.csv(E:/es5.csv, etc) 
i get a data frame that looks like this:

  yi vi
1 5. 0.6667
2 0.6931 0.4667
3 0.4700 0.1500

I can run it using

rma(yi, vi, data=es4)

I have three questions.
1. Can escalc be used in this way to calculate each study effect size 
indvidually and then rbinding them into a data-frame (assuming that it is a 
sensible thing to do, which I realise the above probably isn't)?

2. What is the meaning of the error message:
Error in rma(yi, vi, data = es4) :
  Length of yi and ni vectors are not the same.

3. Is it right to save it as a .csv, open it and re-run it as I have done?


Thanks very much, and to Wolfgang thanks for a great programme! I am using it 
in my MSc teaching here for healthcare students.

Edward

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] metafor combining escalc effect-sizes

2014-03-30 Thread Michael Dewey

At 09:42 30/03/2014, Purssell, Ed wrote:


Dear All

I have a question about combining effect sizes generated by escalc 
in metafor.  I realise these may be stupid things to do; but they 
are deliberately so to explain what I mean - I don't intend doing this!



I have 3 studies; each of which has a different measure of 
effect/presents the data differently, so I use escalc to calculate 
the effect size of each and combine them into a data-frame:


es1-escalc(measure=MD, m1i=10 , m2i=5 , n1i=12 , n2i=12, sd1i=2, sd2i=2)
es2-escalc(measure=RR, ai=10 , bi=5 , ci=12 , di=12)
es3-escalc(measure=RR, ai=10 , ci=5 , n1i=15 , n2i=12)
es4-rbind(es1, es2, es3) # combines the 3 effect sizes into a data frame

attach(es4) # makes the data frame available to R


Not that it is relevant here but it is better not to do that. Just 
use the data = parameter



es5-rma(yi, vi, data=es4) # running the meta analysis here gives 
the error message


Error in rma(yi, vi, data = es4) :
  Length of yi and ni vectors are not the same.


There is some glitch here which is setting the ni attribute of yi 
inappropriately


Try going
attr(es4$yi, ni) - NULL

ad then call rma.uni again

But if I save this as a .csv and open it in R using 
read.csv(E:/es5.csv, etc) i get a data frame that looks like this:


  yi vi
1 5. 0.6667
2 0.6931 0.4667
3 0.4700 0.1500

I can run it using

rma(yi, vi, data=es4)

I have three questions.
1. Can escalc be used in this way to calculate each study effect 
size indvidually and then rbinding them into a data-frame (assuming 
that it is a sensible thing to do, which I realise the above probably isn't)?


2. What is the meaning of the error message:
Error in rma(yi, vi, data = es4) :
  Length of yi and ni vectors are not the same.

3. Is it right to save it as a .csv, open it and re-run it as I have done?


That gets rid of the attributes.



Thanks very much, and to Wolfgang thanks for a great programme! I am 
using it in my MSc teaching here for healthcare students.


Edward

[[alternative HTML version deleted]]


Michael Dewey
i...@aghmed.fsnet.co.uk
http://www.aghmed.fsnet.co.uk/home.html

__
R-help@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.


[R] Metafor - why use escalc?

2014-03-14 Thread Purssell, Ed
Dear All



As you can specify the data directly to rma.uni via n1i, m1i, sd1i, etc in 
Metafor, why would you ever want to use escalc to calculate yi and vi?  Aren't 
these just intermediate steps to the final pooled effect size which is 
calculated by rma.uni; or is there some advantage to calculating yi and vi 
separately using escalc?

Thanks

Ed









[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Metafor - why use escalc?

2014-03-14 Thread Viechtbauer Wolfgang (STAT)
Often, there is a mix of information available from the various studies that 
needs to be used to compute the effect sizes or outcomes to be used for the 
meta-analysis. Then you have to 'build up' your dataset in multiple steps and 
you cannot bypass first using escalc().

As a very basic example, suppose you have 2x2 table data for most studies, but 
for a few studies, you only have the odds ratio and corresponding 95% CI (since 
this is all that the authors reported). The odds ratios are easily converted 
into log odds ratios and the CIs can be used to obtain the sampling variances 
of the log odds ratios. And for the studies for which the 2x2 table data is 
available, one can use escalc() to compute the log odds ratios and 
corresponding sampling variances.

Best,
Wolfgang

From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of 
Purssell, Ed [ed.purss...@kcl.ac.uk]
Sent: Friday, March 14, 2014 10:11 AM
To: r-help@r-project.org
Subject: [R] Metafor - why use escalc?

Dear All

As you can specify the data directly to rma.uni via n1i, m1i, sd1i, etc in 
Metafor, why would you ever want to use escalc to calculate yi and vi?  Aren't 
these just intermediate steps to the final pooled effect size which is 
calculated by rma.uni; or is there some advantage to calculating yi and vi 
separately using escalc?

Thanks

Ed

[[alternative HTML version deleted]]

__
R-help@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.
__
R-help@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.


Re: [R] metafor package

2014-02-13 Thread Nathan Pace
I appreciate the several replies.

efac = 2 had already been set in the forest call.

Adding lwd = 2 in the forest call has improved the visibility of the
credibility interval.

Nathan



-Original Message-
From: Viechtbauer Wolfgang   (STAT)
wolfgang.viechtba...@maastrichtuniversity.nl
Date: Wednesday, February 12, 2014 at 6:39 AM
To: r-help@R-project.org r-help@r-project.org, Nathan Leon Pace, MD,
MStat n.l.p...@utah.edu, Michael Dewey i...@aghmed.fsnet.co.uk, S
Ellison s.elli...@lgcgroup.com
Subject: RE: [R] metafor package

Good advice already from Michael and S Ellison.

I must apologize for the 'hack-job of a function' called forest() in
metafor. I realized a while ago that people would prefer more
fine-grained control over the various elements of the plot (this has come
up a few times before). I think Paul Murrell described the issue best in
his R Journal article:

http://journal.r-project.org/archive/2012-2/RJournal_2012-2_Murrell.pdf

But it is what it is at this point.

I noticed the problem with the dotted line of the credibility interval
myself a while back. In an updated version of the metafor package (to be
released at some point in the near future), there will at least be the
possibility to control the color of that line. Maybe also the line type
(a dotted line is indeed often too faint).

You can try changing efac=2 (or something larger than 1) to at least make
the whiskers longer.

Best,
Wolfgang

--   
Wolfgang Viechtbauer, Ph.D., Statistician
Department of Psychiatry and Psychology
School for Mental Health and Neuroscience
Faculty of Health, Medicine, and Life Sciences
Maastricht University, P.O. Box 616 (VIJV1)
6200 MD Maastricht, The Netherlands
+31 (43) 388-4170 | http://www.wvbauer.com


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of Michael Dewey
 Sent: Wednesday, February 12, 2014 12:50
 To: Nathan Pace; r-help@R-project.org
 Subject: Re: [R] metafor package
 
 At 22:11 11/02/2014, Nathan Pace wrote:
 Hi,
 
 I have a random effects meta analysis of a proportion (logit
 transformation) using rma.glmm.
 
 I have created a forest plot of the proportion (inverse logic
 transformation) using forest.rma.
 
 I have added the credibility interval.
 
 The forest plot is saved as a pdf.
 
 The dotted line and whiskers of the credibility interval are too faint.
 
 I need help on the argument(s) to widen the credibility interval
 dots and whiskers.
 
 I have looked at the forest.default function, but don't see anything
 obvious to me.
 
 Dear Nathan
 I think you need to look at forest.rma. There is a fairly obvious
 section (search for addcred). If worst comes to worst you can always
 hack it and save as nathansforest.rma.
 
 Nathan
 
 --
 Nathan Pace, MD, MStat
 Department of Anesthesiology
 University of Utah
 801.581.6393
 n.l.p...@utah.edu
 
  [[alternative HTML version deleted]]
 
 Michael Dewey
 i...@aghmed.fsnet.co.uk
 http://www.aghmed.fsnet.co.uk/home.html

__
R-help@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.


Re: [R] metafor package

2014-02-12 Thread Michael Dewey

At 22:11 11/02/2014, Nathan Pace wrote:

Hi,

I have a random effects meta analysis of a proportion (logit 
transformation) using rma.glmm.


I have created a forest plot of the proportion (inverse logic 
transformation) using forest.rma.


I have added the credibility interval.

The forest plot is saved as a pdf.

The dotted line and whiskers of the credibility interval are too faint.

I need help on the argument(s) to widen the credibility interval 
dots and whiskers.


I have looked at the forest.default function, but don't see anything 
obvious to me.


Dear Nathan
I think you need to look at forest.rma. There is a fairly obvious 
section (search for addcred). If worst comes to worst you can always 
hack it and save as nathansforest.rma.




Nathan

--
Nathan Pace, MD, MStat
Department of Anesthesiology
University of Utah
801.581.6393
n.l.p...@utah.edu

[[alternative HTML version deleted]]


Michael Dewey
i...@aghmed.fsnet.co.uk
http://www.aghmed.fsnet.co.uk/home.html

__
R-help@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.


Re: [R] metafor package

2014-02-12 Thread S Ellison
Like most plotting routines in R, forest has a ... argument that passes names 
arguments through to other routines.
In forest's case, ... passes (at least) to abline, axis and segments, so all 
the lines and axes in the plot are affected by any argument that is valid for 
those.
In your case, specifying lwd=2 in your forest call will give all the lines 
width 2 instead of the default.

S Ellison

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of Nathan Pace
 Sent: 11 February 2014 22:11
 To: r-help@R-project.org
 Subject: [R] metafor package
 
 Hi,
 
 I have a random effects meta analysis of a proportion (logit transformation)
 using rma.glmm.
 
 I have created a forest plot of the proportion (inverse logic transformation)
 using forest.rma.
 
 I have added the credibility interval.
 
 The forest plot is saved as a pdf.
 
 The dotted line and whiskers of the credibility interval are too faint.
 
 I need help on the argument(s) to widen the credibility interval dots and
 whiskers.
 
 I have looked at the forest.default function, but don't see anything obvious
 to me.
 
 Nathan
 
 --
 Nathan Pace, MD, MStat
 Department of Anesthesiology
 University of Utah
 801.581.6393
 n.l.p...@utah.edu
 
   [[alternative HTML version deleted]]



***
This email and any attachments are confidential. Any use...{{dropped:8}}

__
R-help@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.


Re: [R] metafor package

2014-02-12 Thread Viechtbauer Wolfgang (STAT)
Good advice already from Michael and S Ellison.

I must apologize for the 'hack-job of a function' called forest() in metafor. I 
realized a while ago that people would prefer more fine-grained control over 
the various elements of the plot (this has come up a few times before). I think 
Paul Murrell described the issue best in his R Journal article:

http://journal.r-project.org/archive/2012-2/RJournal_2012-2_Murrell.pdf

But it is what it is at this point.

I noticed the problem with the dotted line of the credibility interval myself a 
while back. In an updated version of the metafor package (to be released at 
some point in the near future), there will at least be the possibility to 
control the color of that line. Maybe also the line type (a dotted line is 
indeed often too faint).

You can try changing efac=2 (or something larger than 1) to at least make the 
whiskers longer.

Best,
Wolfgang

--   
Wolfgang Viechtbauer, Ph.D., Statistician   
Department of Psychiatry and Psychology   
School for Mental Health and Neuroscience   
Faculty of Health, Medicine, and Life Sciences   
Maastricht University, P.O. Box 616 (VIJV1)   
6200 MD Maastricht, The Netherlands   
+31 (43) 388-4170 | http://www.wvbauer.com   


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of Michael Dewey
 Sent: Wednesday, February 12, 2014 12:50
 To: Nathan Pace; r-help@R-project.org
 Subject: Re: [R] metafor package
 
 At 22:11 11/02/2014, Nathan Pace wrote:
 Hi,
 
 I have a random effects meta analysis of a proportion (logit
 transformation) using rma.glmm.
 
 I have created a forest plot of the proportion (inverse logic
 transformation) using forest.rma.
 
 I have added the credibility interval.
 
 The forest plot is saved as a pdf.
 
 The dotted line and whiskers of the credibility interval are too faint.
 
 I need help on the argument(s) to widen the credibility interval
 dots and whiskers.
 
 I have looked at the forest.default function, but don't see anything
 obvious to me.
 
 Dear Nathan
 I think you need to look at forest.rma. There is a fairly obvious
 section (search for addcred). If worst comes to worst you can always
 hack it and save as nathansforest.rma.
 
 Nathan
 
 --
 Nathan Pace, MD, MStat
 Department of Anesthesiology
 University of Utah
 801.581.6393
 n.l.p...@utah.edu
 
  [[alternative HTML version deleted]]
 
 Michael Dewey
 i...@aghmed.fsnet.co.uk
 http://www.aghmed.fsnet.co.uk/home.html

__
R-help@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.


Re: [R] metafor package

2014-02-12 Thread S Ellison


 -Original Message-
 I must apologize for the 'hack-job of a function' called forest() in metafor. 
Well, certainly no apology needed there!

 I realized a while ago that people would prefer more fine-grained control over
 the various elements of the plot (this has come up a few times before). 
Ploting functions should ideally never have hard-coded defaults. 
Having said that, it's an absolute pain to do anything else.

I've tinkered a fair bit with the problem in my own package, which for at least 
some plots tries to match graphical arguments in ... with those applicable to 
specific plotting functions so as to avoid the frequent 'duplicate parameters' 
or 'xxx is not a recognised parameter in some_plotting_function'

Another useful approach I've toyed with is to allow a list like 
this.special.line.pars=list(lwd=2, col=3, lty=2) to be provided, and then use 
do.call with functions like line, axis etc. That avoids a plot function full of 
things like like this.special.line.lwd, like this.special.line.col, like 
this.special.line.lty 

But there's no really simple answer; at some point we have to give up and point 
out that if saomeone really wants that much control, they can always hack the 
code!

S Ellison


***
This email and any attachments are confidential. Any use...{{dropped:8}}

__
R-help@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.


[R] metafor package

2014-02-12 Thread William Shadish

If your command looks something like this:

 forest(x,xlim=c(-6,7),cex=.8,order=prec, xlab=Effect Size, 
alim=c(-.5,4),mlab=RE Average for All Studies)


In  alim=c(-.5,4), increase the numbers.  Make them higher than your 
highest confidence interval upper bound and lower than your lowest 
confidence interval lower bound. The bars may run into the text, but 
that may be fixed by stretching the output window in R.


Will Shadish
**

Date: Tue, 11 Feb 2014 22:11:20 +
From: Nathan Pace n.l.p...@utah.edu
To: r-help@R-project.org r-help@r-project.org
Subject: [R] metafor package
Message-ID: cf1fef68.2490a%n.l.p...@utah.edu
Content-Type: text/plain

Hi,

I have a random effects meta analysis of a proportion (logit 
transformation) using rma.glmm.


I have created a forest plot of the proportion (inverse logic 
transformation) using forest.rma.


I have added the credibility interval.

The forest plot is saved as a pdf.

The dotted line and whiskers of the credibility interval are too faint.

I need help on the argument(s) to widen the credibility interval dots 
and whiskers.


I have looked at the forest.default function, but don?t see anything 
obvious to me.


Nathan

--
Nathan Pace, MD, MStat
Department of Anesthesiology
University of Utah
801.581.6393
n.l.p...@utah.edu
--
William R. Shadish
Distinguished Professor
Founding Faculty

Mailing Address:
William R. Shadish
University of California
School of Social Sciences, Humanities and Arts
5200 North Lake Rd
Merced CA  95343

Physical/Delivery Address:
University of California Merced
ATTN: William Shadish
School of Social Sciences, Humanities and Arts
Facilities Services Building A
5200 North Lake Rd.
Merced, CA 95343

209-228-4372 voice
209-228-4007 fax (communal fax: be sure to include cover sheet)
wshad...@ucmerced.edu
http://faculty.ucmerced.edu/wshadish/index.htm
http://psychology.ucmerced.edu

__
R-help@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.


[R] metafor package

2014-02-11 Thread Nathan Pace
Hi,

I have a random effects meta analysis of a proportion (logit transformation) 
using rma.glmm.

I have created a forest plot of the proportion (inverse logic transformation) 
using forest.rma.

I have added the credibility interval.

The forest plot is saved as a pdf.

The dotted line and whiskers of the credibility interval are too faint.

I need help on the argument(s) to widen the credibility interval dots and 
whiskers.

I have looked at the forest.default function, but don’t see anything obvious to 
me.

Nathan

--
Nathan Pace, MD, MStat
Department of Anesthesiology
University of Utah
801.581.6393
n.l.p...@utah.edu

[[alternative HTML version deleted]]

__
R-help@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.


[R] metafor escalc(measure=SMCC)

2013-11-22 Thread petretta

Many thanks to Wolfgang Wiechtbauer for the explanation.

Sincerely

Mario Petretta


Message: 31
 Date: Thu, 21 Nov 2013 19:08:14 +0100
 From: Viechtbauer Wolfgang (STAT)
 wolfgang.viechtba...@maastrichtuniversity.nl
 To: petre...@unina.it petre...@unina.it, r-help@r-project.org
 r-help@r-project.org
 Subject: Re: [R] metafor escalc(measure=SMCC)
 Message-ID:
 077e31a57da26e46ab0d493c9966ac730d99255...@um-mail4112.unimaas.nl
 Content-Type: text/plain; charset=us-ascii

 .cmicalc is a non-exported function. You can see the code with:

 getAnywhere(.cmicalc)

 Best,
 Wolfgang


[Nascondi Testo quotato]
-Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of petre...@unina.it
 Sent: Thursday, November 21, 2013 13:39
 To: r-help@r-project.org
 Subject: [R] metafor escalc(measure=SMCC)

 Many thanks to Wolfgang Viechtbauer for the prompt and clear answer.
 However, I'm unable to understand what .cmicalc mathematically does in the
 code line:

 cmi - .cmicalc(mi)

 I look in the metafor documentation and in R (?.cmical and ??.cmicalc) but
 I have no result. Please, can I have further explanation on this point?

 Sorry for the trouble

 Sincerely

 Mario Petretta
 Department of Translational Medical Sciences
 Naples University Federico II
 Italy




Message: 50 Date: Tue, 19 Nov 2013 11:48:33 +0100
 From: Viechtbauer Wolfgang (STAT)
  wolfgang.viechtba...@maastrichtuniversity.nl
 To: petre...@unina.it petre...@unina.it, r-help@r-project.org
  r-help@r-project.org
 Subject: Re: [R] metafor escalc(measure=SMCC)
 Message-ID:
  077E31A57DA26E46AB0D493C9966AC730D9925568A@UM-
MAIL4112.unimaas.nl
 Content-Type: text/plain; charset=us-ascii

 Dear Mario,

 You can always just inspect the code:

 escalc.default

 Best,
 Wolfgang

 --
 Wolfgang Viechtbauer, Ph.D., Statistician
 Department of Psychiatry and Psychology
 School for Mental Health and Neuroscience
 Faculty of Health, Medicine, and Life Sciences
 Maastricht University, P.O. Box 616 (VIJV1)
 6200 MD Maastricht, The Netherlands
 +31 (43) 388-4170 | http://www.wvbauer.com


-Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of petre...@unina.it
 Sent: Tuesday, November 19, 2013 11:29
 To: r-help@r-project.org
 Subject: [R] metafor escalc(measure=SMCC)

 Dear all,

 I use R 3.0 for Windows.

 I ask how escalc(measure=SMCC) [metafor package] mathematically
 calculate yi and vi when only change score and SD change score are
 provided.

 I used the example (repoted below) posted by Qiang Yue at:

http://r.789695.n4.nabble.com/using-metafor-for-meta-analysis-of-before-
 after-studies-escalc-SMCC-td4667233.html

 but it is unclear for me the formula used to derive y1 and v1. I read
 the documentation of metafor package and it is all very well
 described, but I ask if possible for the formula used by
 escalc(measure=SMCC) to mathematically calculate yi and vi.
 Unfortunatel, I have no free access to the paper quoted in metafor
 package.

 Beginning example:

 fMRS
 author year n mean_r sd_r mean_s sd_s r
 1 Tom  2006 9  0   0 0.12 0.030   0
 2 Jack 2012 6  0   0 0.23 0.050   0
 3 Zhu  2013 8  0   0 0.18 0.050   0




dat_SMCC=escalc(measure=SMCC,data=fMRS,ni=n,m1i=mean_s,m2i=mean_r,sd1i=s
d_s,sd2i=sd_r,ri=r
 ,append=TRUE)

dat_SMCC

author year n mean_r sd_r mean_s sd_s r  yi  vi 1 Tom 2006  9  0
  00.12  0.03  0 3.6108 0.8354

 2 Jack 2012 6  0 00.23  0.05  0 3.8674 1.4131
 3 Zhu 2013  8  0 00.18  0.05  0 3.1975 0.7640



 Sincerely

 --
 Mario Petretta
 Department of Translational Medical Sciences
 Naples University Federico II
 Italy

__
R-help@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.


--
Mario Petretta
Department of Translational Medical Sciences
Naples University Federico II
Italy

__
R-help@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.


[R] metafor escalc(measure=SMCC)

2013-11-21 Thread petretta
Many thanks to Wolfgang Viechtbauer for the prompt and clear answer.
However, I'm unable to understand what .cmicalc mathematically does in the
code line:

cmi - .cmicalc(mi)

I look in the metafor documentation and in R (?.cmical and ??.cmicalc) but
I have no result. Please, can I have further explanation on this point?

Sorry for the trouble

Sincerely

Mario Petretta
Department of Translational Medical Sciences
Naples University Federico II
Italy


Message: 50
Date: Tue, 19 Nov 2013 11:48:33 +0100
From: Viechtbauer Wolfgang (STAT)
wolfgang.viechtba...@maastrichtuniversity.nl
To: petre...@unina.it petre...@unina.it, r-help@r-project.org
r-help@r-project.org
Subject: Re: [R] metafor escalc(measure=SMCC)
Message-ID:
077e31a57da26e46ab0d493c9966ac730d99255...@um-mail4112.unimaas.nl
Content-Type: text/plain; charset=us-ascii

Dear Mario,

You can always just inspect the code:

escalc.default

Best,
Wolfgang

--
Wolfgang Viechtbauer, Ph.D., Statistician
Department of Psychiatry and Psychology
School for Mental Health and Neuroscience
Faculty of Health, Medicine, and Life Sciences
Maastricht University, P.O. Box 616 (VIJV1)
6200 MD Maastricht, The Netherlands
+31 (43) 388-4170 | http://www.wvbauer.com

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of petre...@unina.it
 Sent: Tuesday, November 19, 2013 11:29
 To: r-help@r-project.org
 Subject: [R] metafor escalc(measure=SMCC)

 Dear all,

 I use R 3.0 for Windows.

 I ask how escalc(measure=SMCC) [metafor package] mathematically
 calculate yi and vi when only change score and SD change score are
 provided.

 I used the example (repoted below) posted by Qiang Yue at:

 http://r.789695.n4.nabble.com/using-metafor-for-meta-analysis-of-before-
 after-studies-escalc-SMCC-td4667233.html

 but it is unclear for me the formula used to derive y1 and v1. I read
 the documentation of metafor package and it is all very well
 described, but I ask if possible for the formula used by
 escalc(measure=SMCC) to mathematically calculate yi and vi.
 Unfortunatel, I have no free access to the paper quoted in metafor
 package.

 Beginning example:

 fMRS
 author year n mean_r sd_r mean_s sd_s r
 1 Tom  2006 9  0   0 0.12 0.030   0
 2 Jack 2012 6  0   0 0.23 0.050   0
 3 Zhu  2013 8  0   0 0.18 0.050   0

 
 dat_SMCC=escalc(measure=SMCC,data=fMRS,ni=n,m1i=mean_s,m2i=mean_r,sd1i=s
 d_s,sd2i=sd_r,ri=r
 ,append=TRUE)
  dat_SMCC
 author year n mean_r sd_r mean_s sd_s r  yi  vi
 1 Tom 2006  9  0 00.12  0.03  0 3.6108 0.8354
 2 Jack 2012 6  0 00.23  0.05  0 3.8674 1.4131
 3 Zhu 2013  8  0 00.18  0.05  0 3.1975 0.7640



 Sincerely

 --
 Mario Petretta
 Department of Translational Medical Sciences
 Naples University Federico II
 Italy


__
R-help@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.


Re: [R] metafor escalc(measure=SMCC)

2013-11-21 Thread Viechtbauer Wolfgang (STAT)
.cmicalc is a non-exported function. You can see the code with:

getAnywhere(.cmicalc)

Best,
Wolfgang

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of petre...@unina.it
 Sent: Thursday, November 21, 2013 13:39
 To: r-help@r-project.org
 Subject: [R] metafor escalc(measure=SMCC)
 
 Many thanks to Wolfgang Viechtbauer for the prompt and clear answer.
 However, I'm unable to understand what .cmicalc mathematically does in the
 code line:
 
 cmi - .cmicalc(mi)
 
 I look in the metafor documentation and in R (?.cmical and ??.cmicalc) but
 I have no result. Please, can I have further explanation on this point?
 
 Sorry for the trouble
 
 Sincerely
 
 Mario Petretta
 Department of Translational Medical Sciences
 Naples University Federico II
 Italy
 
 
 Message: 50
 Date: Tue, 19 Nov 2013 11:48:33 +0100
 From: Viechtbauer Wolfgang (STAT)
 wolfgang.viechtba...@maastrichtuniversity.nl
 To: petre...@unina.it petre...@unina.it, r-help@r-project.org
 r-help@r-project.org
 Subject: Re: [R] metafor escalc(measure=SMCC)
 Message-ID:
 077E31A57DA26E46AB0D493C9966AC730D9925568A@UM-
 MAIL4112.unimaas.nl
 Content-Type: text/plain; charset=us-ascii
 
 Dear Mario,
 
 You can always just inspect the code:
 
 escalc.default
 
 Best,
 Wolfgang
 
 --
 Wolfgang Viechtbauer, Ph.D., Statistician
 Department of Psychiatry and Psychology
 School for Mental Health and Neuroscience
 Faculty of Health, Medicine, and Life Sciences
 Maastricht University, P.O. Box 616 (VIJV1)
 6200 MD Maastricht, The Netherlands
 +31 (43) 388-4170 | http://www.wvbauer.com
 
  -Original Message-
  From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
  On Behalf Of petre...@unina.it
  Sent: Tuesday, November 19, 2013 11:29
  To: r-help@r-project.org
  Subject: [R] metafor escalc(measure=SMCC)
 
  Dear all,
 
  I use R 3.0 for Windows.
 
  I ask how escalc(measure=SMCC) [metafor package] mathematically
  calculate yi and vi when only change score and SD change score are
  provided.
 
  I used the example (repoted below) posted by Qiang Yue at:
 
  http://r.789695.n4.nabble.com/using-metafor-for-meta-analysis-of-before-
  after-studies-escalc-SMCC-td4667233.html
 
  but it is unclear for me the formula used to derive y1 and v1. I read
  the documentation of metafor package and it is all very well
  described, but I ask if possible for the formula used by
  escalc(measure=SMCC) to mathematically calculate yi and vi.
  Unfortunatel, I have no free access to the paper quoted in metafor
  package.
 
  Beginning example:
 
  fMRS
  author year n mean_r sd_r mean_s sd_s r
  1 Tom  2006 9  0   0 0.12 0.030   0
  2 Jack 2012 6  0   0 0.23 0.050   0
  3 Zhu  2013 8  0   0 0.18 0.050   0
 
  
 
 dat_SMCC=escalc(measure=SMCC,data=fMRS,ni=n,m1i=mean_s,m2i=mean_r,sd1i=s
  d_s,sd2i=sd_r,ri=r
  ,append=TRUE)
   dat_SMCC
  author year n mean_r sd_r mean_s sd_s r  yi  vi
  1 Tom 2006  9  0 00.12  0.03  0 3.6108 0.8354
  2 Jack 2012 6  0 00.23  0.05  0 3.8674 1.4131
  3 Zhu 2013  8  0 00.18  0.05  0 3.1975 0.7640
 
 
 
  Sincerely
 
  --
  Mario Petretta
  Department of Translational Medical Sciences
  Naples University Federico II
  Italy
 
 
 __
 R-help@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.

__
R-help@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.


[R] metafor escalc(measure=SMCC)

2013-11-19 Thread petretta

Dear all,

I use R 3.0 for Windows.

I ask how escalc(measure=SMCC) [metafor package] mathematically  
calculate yi and vi when only change score and SD change score are  
provided.


I used the example (repoted below) posted by Qiang Yue at:

http://r.789695.n4.nabble.com/using-metafor-for-meta-analysis-of-before-after-studies-escalc-SMCC-td4667233.html

but it is unclear for me the formula used to derive y1 and v1. I read  
the documentation of metafor package and it is all very well  
described, but I ask if possible for the formula used by  
escalc(measure=SMCC) to mathematically calculate yi and vi.  
Unfortunatel, I have no free access to the paper quoted in metafor  
package.


Beginning example:

fMRS
author year n mean_r sd_r mean_s sd_s r
1 Tom  2006 9  0   0 0.12 0.030   0
2 Jack 2012 6  0   0 0.23 0.050   0
3 Zhu  2013 8  0   0 0.18 0.050   0


dat_SMCC=escalc(measure=SMCC,data=fMRS,ni=n,m1i=mean_s,m2i=mean_r,sd1i=sd_s,sd2i=sd_r,ri=r

,append=TRUE)

dat_SMCC

author year n mean_r sd_r mean_s sd_s r  yi  vi
1 Tom 2006  9  0 00.12  0.03  0 3.6108 0.8354
2 Jack 2012 6  0 00.23  0.05  0 3.8674 1.4131
3 Zhu 2013  8  0 00.18  0.05  0 3.1975 0.7640



Sincerely

--
Mario Petretta
Department of Translational Medical Sciences
Naples University Federico II
Italy

__
R-help@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.


Re: [R] metafor escalc(measure=SMCC)

2013-11-19 Thread Viechtbauer Wolfgang (STAT)
Dear Mario,

You can always just inspect the code:

escalc.default

Best,
Wolfgang

--   
Wolfgang Viechtbauer, Ph.D., Statistician   
Department of Psychiatry and Psychology   
School for Mental Health and Neuroscience   
Faculty of Health, Medicine, and Life Sciences   
Maastricht University, P.O. Box 616 (VIJV1)   
6200 MD Maastricht, The Netherlands   
+31 (43) 388-4170 | http://www.wvbauer.com   

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of petre...@unina.it
 Sent: Tuesday, November 19, 2013 11:29
 To: r-help@r-project.org
 Subject: [R] metafor escalc(measure=SMCC)
 
 Dear all,
 
 I use R 3.0 for Windows.
 
 I ask how escalc(measure=SMCC) [metafor package] mathematically
 calculate yi and vi when only change score and SD change score are
 provided.
 
 I used the example (repoted below) posted by Qiang Yue at:
 
 http://r.789695.n4.nabble.com/using-metafor-for-meta-analysis-of-before-
 after-studies-escalc-SMCC-td4667233.html
 
 but it is unclear for me the formula used to derive y1 and v1. I read
 the documentation of metafor package and it is all very well
 described, but I ask if possible for the formula used by
 escalc(measure=SMCC) to mathematically calculate yi and vi.
 Unfortunatel, I have no free access to the paper quoted in metafor
 package.
 
 Beginning example:
 
 fMRS
 author year n mean_r sd_r mean_s sd_s r
 1 Tom  2006 9  0   0 0.12 0.030   0
 2 Jack 2012 6  0   0 0.23 0.050   0
 3 Zhu  2013 8  0   0 0.18 0.050   0
 
 
 dat_SMCC=escalc(measure=SMCC,data=fMRS,ni=n,m1i=mean_s,m2i=mean_r,sd1i=s
 d_s,sd2i=sd_r,ri=r
 ,append=TRUE)
  dat_SMCC
 author year n mean_r sd_r mean_s sd_s r  yi  vi
 1 Tom 2006  9  0 00.12  0.03  0 3.6108 0.8354
 2 Jack 2012 6  0 00.23  0.05  0 3.8674 1.4131
 3 Zhu 2013  8  0 00.18  0.05  0 3.1975 0.7640
 
 
 
 Sincerely
 
 --
 Mario Petretta
 Department of Translational Medical Sciences
 Naples University Federico II
 Italy
 
 __
 R-help@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.

__
R-help@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.


  1   2   >