Learn R Programming

metafor (version 1.9-4)

profile.rma.uni: Profile Plots for 'rma' Objects

Description

Function to profile the (restricted) log-likelihood for objects of class "rma.uni" and "rma.mv".

Usage

## S3 method for class 'rma.uni':
profile(fitted, xlim, ylim, steps=20, progbar=TRUE, plot=TRUE, pch=19, \ldots)

## S3 method for class 'rma.mv':
profile(fitted, sigma2, tau2, rho, xlim, ylim,
        steps=20, startmethod="init", progbar=TRUE, plot=TRUE, pch=19, \ldots)

Arguments

fitted
an object of class "rma.uni" or "rma.mv".
sigma2
integer specifying for which latex{$\sigma^2$}html{$\sigma²$}text{$\sigma^2$} value the likelihood should be profiled (only relevant for "rma.mv" objects).
tau2
integer specifying for which latex{$\tau^2$}html{$\tau²$}text{$\tau^2$} value the likelihood should be profiled (only relevant for "rma.mv" objects).
rho
integer specifying for which $\rho$ value the likelihood should be profiled (only relevant for "rma.mv" objects).
xlim
optional vector specifying the lower and upper limit of the parameter over which the profiling should be done. If unspecified, the function tries to set these limits automatically.
ylim
optional vector specifying the y-axis limits when plotting the profiled likelihood. If unspecified, the function tries to set these limits automatically.
steps
number of points between xlim[1] and xlim[2] (inclusive) for which the likelihood should be obtained (default is 20).
startmethod
method for picking starting values for the optimization. Default is "init", which starts each model fit at the default initial values. The alternative is "prev", which starts at the estimates from the previous model fit (usually
progbar
logical indicating whether a progress bar should be shown (default is TRUE).
plot
logical indicating whether the profile plot should be drawn after profiling is finished (default is TRUE).
pch
plotting symbol to use. By default, a filled circle is used. See points for other options.
...
other arguments.

Value

  • An object of class "profile.rma.uni" or "profile.rma.mv". The object is a list containing the following components:
  • sigma2values of latex{$\sigma^2$}html{$\sigma²$}text{$\sigma^2$} over which the likelihood was profiled (only when profiling was actually done over latex{$\sigma^2$}html{$\sigma²$}text{$\sigma^2$}).
  • tau2values of latex{$\tau^2$}html{$\tau²$}text{$\tau^2$} over which the likelihood was profiled (only when profiling was actually done over latex{$\tau^2$}html{$\tau²$}text{$\tau^2$}).
  • rhovalues of $\rho$ over which the likelihood was profiled (only when profiling was actually done over $\rho$).
  • ll(restricted) log-likelihood at the corresponding parameter value.
  • ba matrix with the estimated model coefficients at the corresponding parameter value.
  • ci.lba matrix with the lower confidence interval bounds for the model coefficients at the corresponding parameter value.
  • ci.uba matrix with the upper confidence interval bounds for the model coefficients at the corresponding parameter value.
  • Note that the list is returned invisibly.

Details

The function fixes a particular variance component or correlation parameter of the model and then computes the maximized (restricted) log-likelihood over the remaining parameters of the model. By doing this for a range of values for the parameter that was fixed, a profile of the (restricted) log-likelihood is obtained. For objects of class "rma.uni", the function profiles over parameter latex{$\tau^2$}html{$\tau²$}text{$\tau^2$}. If method="ML" or method="REML" when fitting the model with the rma.uni function, the profiled regular/restricted log-likelihood should be maximized at the ML/REML estimate of latex{$\tau^2$}html{$\tau²$}text{$\tau^2$}. For objects of class "rma.mv" obtained with the rma.mv function, one must use the sigma2, tau2, and rho arguments to specify over which parameter the profiling should be done. Only one of these arguments can be used at a time. A single integer is used to specify the number of the parameter. Each profile plot should show a clear peak at the corresponding ML/REML estimate. If the profiled likelihood is flat (over the entire parameter space or large portions of it), then this suggests that at least some of the parameters of the model are not identifiable (and the parameter estimates obtained are essentially arbitrary).

References

Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1--48. http://www.jstatsoft.org/v36/i03/.

See Also

rma.uni, rma.mv

Examples

Run this code
### load BCG vaccine data
data(dat.bcg)

### calculate log odds ratios and corresponding sampling variances
dat <- escalc(measure="OR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)

### random-effects model using rma.uni()
res <- rma(yi, vi, data=dat)

### profile over tau^2
profile(res)

### change data into long format
dat.long <- to.long(measure="OR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)

### set levels of group variable ("exp" = experimental/vaccinated; "con" = control/non-vaccinated)
levels(dat.long$group) <- c("exp", "con")

### set "con" to reference level
dat.long$group <- relevel(dat.long$group, ref="con")

### calculate log odds and corresponding sampling variances
dat.long <- escalc(measure="PLO", xi=out1, mi=out2, data=dat.long)

### bivariate random-effects model using rma.mv()
res <- rma.mv(yi, vi, mods = ~ group, random = ~ group | study, struct="UN", data=dat.long)
res

### profile over tau^2_1, tau^2_2, and rho
### note: for rho, adjust region over which profiling is done ("zoom in" on area around estimate)
par(mfrow=c(3,1))
profile(res, tau2=1)
profile(res, tau2=2)
profile(res, rho=1, xlim=c(.90, .98))

Run the code above in your browser using DataLab