fitted.blsmeta: Expected Values of the Predictive Distribution

Description Usage Arguments Value Examples

View source: R/fitted_blsmeta.R

Description

Compute the expected (analogous to "fitted") values for a blsmeta object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## S3 method for class 'blsmeta'
fitted(
  object,
  newdata = NULL,
  es_id = TRUE,
  study_id = TRUE,
  summary = TRUE,
  cred = 0.95,
  digits = 3,
  ...
)

Arguments

object

An object of class blsmeta.

newdata

An optional data.frame for which to compute fit fitted values. Defaults to NULL, which then uses the original data used in blsmeta.

es_id

logical. Should the level two "random" effect be included (defaults to TRUE)

study_id

logical. Should the level three "random" effects be included (defaults to TRUE)?

summary

logical. Should the posterior samples be summarized (defaults to TRUE)?

cred

numeric. credible interval (defaults to 0.95).

digits

numeric. The desired number of digits for the summarized estimates (defaults to 3).

...

Currently ignored.

Value

A data frame of fitted values (when summary = TRUE),

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(psymetadata)

dat <- gnambs2020

fit <- blsmeta(yi = yi,
               vi = vi,
               es_id = es_id,
               data = dat)
               
fitted(fit)

donaldRwilliams/blsmeta documentation built on Dec. 20, 2021, 12:12 a.m.