Learn R Programming

smicd (version 1.1.5)

semLm: Linear Regression with Interval-Censored Dependent Variable

Description

This function estimates the linear regression model when the dependent variable is interval-censored. The estimation of the standard errors is fasciliated by a non-parametric bootstrap.

Usage

semLm(
  formula,
  data,
  classes,
  burnin = 40,
  samples = 200,
  trafo = "None",
  adjust = 2,
  bootstrap.se = FALSE,
  b = 100
)

Value

An object of class "sem" that provides parameter estimates for linear regression models with interval-censored dependent variable. Generic functions such as, print, plot, and summary have methods that can be used to obtain further information. See semObject for a description of the components of objects of class "sem".

Arguments

formula

an object of class formula, as in lm. The dependent variable is measured as interval-censored values; factor with ordered factor values

data

a data frame containing the variables of the model

classes

numeric vector of classes; -Inf as lower interval bound and Inf as upper interval bound is allowed. If the Box-Cox or logarithmic transformation is chosen, the minimum interval bound must be \(\ge 0\).

burnin

the number of burn-in iterations of the SEM-algorithm

samples

the number of additional iterations of the SEM-algorithm for parameter estimation

trafo

transformation of the dependent variable to fulfill the model assumptions

  • "log" for Logarithmic transformation

  • "bc" for Box-Cox transformation

default is "None". Transformations can only be used if the minimum interval bound is \(\ge 0\).

adjust

extends the number of iteration steps of the SEM-algorithm for finding the optimal lambda of the Box-Cox transformation. The number of iterations is extended in the following way: (burnin+samples)*adjust

bootstrap.se

if TRUE standard errors of the regression parameters are estimated

b

number of bootstrap iterations for the estimation of the standard errors

Details

The model parameters are estimated using pseudo samples as a proxy for the interval-censored dependent variable. The object pseudo.y returns the pseudo samples of each iteration step of the SEM-algorithm.

References

Walter, P. (2019). A Selection of Statistical Methods for Interval-Censored Data with Applications to the German Microcensus, PhD thesis, Freie Universitaet Berlin

See Also

lm, print.sem, plot.sem, summary.sem

Examples

Run this code
if (FALSE) {
# Load and prepare data
data <- Exam
classes <- c(1, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.7, 8.5, Inf)
data$examsc.class <- cut(data$examsc, classes)

# Run model with default settings
model <- semLm(
  formula = examsc.class ~ standLRT + schavg, data = data,
  classes = classes
)
summary(model)
}
# \dontshow{
# Load and prepare data
data <- Exam
classes <- c(1, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.7, 8.5, Inf)
data$examsc.class <- cut(data$examsc, classes)

# Run model with default settings
model <- semLm(
  formula = examsc.class ~ standLRT + schavg, data = data,
  classes = classes, burnin = 4, samples = 10
)
summary(model)
# }

Run the code above in your browser using DataLab