funnelPlot: Plot function for a list of sienaFit objects

View source: R/siena08.r

funnelPlotR Documentation

Plot function for a list of sienaFit objects

Description

Draws a funnel plot for a list of sienaFit objects that all have estimated the same parameter.

Usage

funnelPlot(anslist, k, threshold=NULL, origin=TRUE,
           plotAboveThreshold=TRUE, verbose=TRUE, ...)

Arguments

anslist

A list of object of class sienaFit.

k

The number of the parameter to be plotted.

threshold

threshold for standard errors: all estimations where the standard error for parameter k is larger than this threshold will be disregarded.

origin

Boolean: whether to include the origin in the plot, if all estimates have the same sign.

plotAboveThreshold

Boolean: whether to include the estimates for which the standard error is larger than threshold, and plot them with an asterisk at se=threshold.

verbose

Boolean: whether to report in the console all estimates omitted, because either their standard error is larger than threshold, or they were fixed.

...

For extra arguments (passed to plot).

Details

The function funnelPlot plots estimates against standard errors for a given effect k, with red reference lines added at the two-sided significance threshold 0.05. Effects for which a score test was requested are not plotted (and reported to the console if verbose).
If not all effects with number k are the same in all sienaFit objects, a warning is given. The effect name for the first object is used as the plot title.
Another funnel plot is available as print.sienaMeta.

Value

The two-column matrix of values of the plotted points is invisibly returned.

Author(s)

Tom Snijders

See Also

siena08, print.sienaMeta

Examples

# A meta-analysis for three groups does not make much sense.
# But using three groups shows the idea.

Group1 <- sienaDependent(array(c(N3401, HN3401), dim=c(45, 45, 2)))
Group3 <- sienaDependent(array(c(N3403, HN3403), dim=c(37, 37, 2)))
Group4 <- sienaDependent(array(c(N3404, HN3404), dim=c(33, 33, 2)))
dataset.1 <- sienaDataCreate(Friends = Group1)
dataset.3 <- sienaDataCreate(Friends = Group3)
dataset.4 <- sienaDataCreate(Friends = Group4)
OneAlgorithm <- sienaAlgorithmCreate(projname = NULL, nsub=1, n3=50, seed=123)
effects.1 <- getEffects(dataset.1)
effects.3 <- getEffects(dataset.3)
effects.4 <- getEffects(dataset.4)
ans.1 <- siena07(OneAlgorithm, data=dataset.1, effects=effects.1, batch=TRUE)
ans.3 <- siena07(OneAlgorithm, data=dataset.3, effects=effects.3, batch=TRUE)
ans.4 <- siena07(OneAlgorithm, data=dataset.4, effects=effects.4, batch=TRUE)
funnelPlot(list(ans.1, ans.3, ans.4), k=2)
funnelPlot(list(ans.1, ans.3, ans.4), k=2, origin=FALSE)

RSiena documentation built on Nov. 2, 2023, 5:19 p.m.