alpha.beta.sigma: Build an alpha-beta-sigma Matrix for Use with the cplot...

View source: R/alpha.beta.sigma.R

alpha.beta.sigmaR Documentation

Build an alpha-beta-sigma Matrix for Use with the cplot Function

Description

Creates a 3 \times N (no. of methods) matrix consisting of the estimated alphas, betas, and imprecision sigmas for use with the cplot function.

Usage

alpha.beta.sigma(x)

Arguments

x

A k \times 3 data.frame with parameter estimates in the second column where k is the number of methods m \times 3. The estimates should be arranged with the estimated m-1 betas first, followed by the m residual variances, the variance of the true values, the m-1 alphas, the mean of the true values. The omx function returns the fitted model in fit from which parameter estimates can be retrieved. See the examples below.

Details

This is primarily a helper function used by the omx function.

Value

A 3 \times N matrix consisting of alphas on the first row, betas on the second row, followed by raw imprecision sigmas.

See Also

cplot, omx.

Examples


## Not run: 
library(OpenMx)
library(merror)
data(pm2.5)
pm <- pm2.5

# OpenMx does not like periods in data column names
names(pm) <- c('ms_conc_1','ws_conc_1','ms_conc_2','ws_conc_2','frm')

# Fit model with FRM sampler as reference
omxfit <- omx(data=pm[,c(5,1:4)],bs.q=c(0.025,0.5,0.975),reps=100)

# Extract the estimates
alpha.beta.sigma(summary(omxfit$fit)$parameters[,c(1,5,6)])

# Make a calibration plot
cplot(pm[,c(5,1:4)],1,2,alpha.beta.sigma=
  alpha.beta.sigma(summary(omxfit$fit)$parameters[,c(1,5,6)]))

# The easier way
cplot(pm[,c(5,1:4)],1,2,alpha.beta.sigma=omxfit$abs)

## End(Not run)

merror documentation built on Aug. 29, 2023, 5:06 p.m.