confint.RSA: Computes confidence intervals for RSA parameters, standard or...

View source: R/confint.R

confint.RSAR Documentation

Computes confidence intervals for RSA parameters, standard or bootstrapped

Description

Computes confidence intervals for RSA parameters, standard or bootstrapped (using a percentile bootstrap)

Usage

## S3 method for class 'RSA'
confint(
  object,
  parm,
  level = 0.95,
  ...,
  model = "full",
  digits = 3,
  method = "standard",
  R = 5000
)

Arguments

object

An RSA object

parm

Not used.

level

The confidence level required.

...

Additional parameters passed to the bootstrapLavaan function, e.g., parallel="multicore", ncpus=2.

model

A string specifying the model; defaults to "full"

digits

Number of digits the output is rounded to; if NA, digits are unconstrained

method

"standard" returns the CI for the lavaan object as it was computed. "boot" computes new percentile bootstrapped CIs.

R

If method = "boot", R specifies the number of bootstrap samples

Details

There are two ways of getting bootstrapped CIs and p-values in the RSA package If you use the option se="boot" in the RSA function, lavaan provides CIs and p-values based on the bootstrapped standard error (not percentile bootstraps). If you use confint(..., method="boot"), in contrast, you get CIs and p-values based on percentile bootstrap.

See Also

RSA

Examples


## Not run: 
set.seed(0xBEEF)
n <- 300
err <- 2
x <- rnorm(n, 0, 5)
y <- rnorm(n, 0, 5)
df <- data.frame(x, y)
df <- within(df, {
	diff <- x-y
	absdiff <- abs(x-y)
	SD <- (x-y)^2
	z.sq <- SD + rnorm(n, 0, err)
})

r1 <- RSA(z.sq~x*y, df, models="SSQD")
(c1 <- confint(r1, model="SSQD"))

# Dummy example with 10 bootstrap replications - better use >= 5000!
(c2 <- confint(r1, model="SSQD", method="boot", R=10))
# multicore version
confint(r1, model="SSQD", R=5000, parallel="multicore", ncpus=2)

## End(Not run)

RSA documentation built on Jan. 12, 2023, 9:07 a.m.

Related to confint.RSA in RSA...