predict.weightfunct {weightr} | R Documentation |
Predicted Values for 'weightfunct' Objects
Description
This function calculates predicted conditional means and their corresponding standard errors for objects of class weightfunct.
Usage
## S3 method for class 'weightfunct'
predict(object, values = NULL, ...)
Arguments
object |
an object of class weightfunct |
values |
a vector or matrix specifying the values of the moderator variables for which predicted values should be calculated; defaults to |
... |
other arguments |
Details
predict(object)
requires that the user specify a vector or matrix of predictor values. Without specifying values, the function will not work.
For models including y
number of moderator variables, users should set values
equal to a k
x y
matrix, where k
is the number of rows of data (i.e., "new" studies). In the example code, for example, there are 3 moderator variables and one row of data, so values
is a 1 x 3 matrix. The intercept is incldued by default.
Note that weightfunct
handles categorical moderators automatically. To include them here, the appropriate contrast (dummy) variables must be explicitly specified. The contrasts
function can help to understand the contrast matrix for a given factor.
Value
The function returns a list containing the following components: unadjusted
, adjusted
, and values
. The values
section simply prints the values
matrix for verification. The unadjusted
and adjusted
sections print the conditional means for each row of new data, unadjusted and adjusted for publication bias (respectively), and their standard errors.
Examples
## Not run:
test <- weightfunct(effect, v, mods=~x1 + x2 + x3, steps)
values <- matrix(c(0,1,0),ncol=3) # An arbitrary set of 3 dummy-coded moderators
predict(test, values)
## End(Not run)