Learn R Programming

LMest (version 3.0.0)

se: Standard errors

Description

Function to compute standard errors for the parameter estimates.

Usage

se(est, ...)
# S3 method for LMbasic
se(est, ...)
# S3 method for LMbasiccont
se(est, ...)
# S3 method for LMlatent
se(est, ...)
# S3 method for LMlatentcont
se(est, ...)

Arguments

est

an object obtained from a call to lmest and lmestCont

further arguments

Value

Standard errors for estimates in est object.

Examples

Run this code
# NOT RUN {
# LM model for categorical responses without covariates 

data("data_SRHS_long")
SRHS <- data_SRHS_long[1:2400,]

# Categories rescaled to vary from 0 (<U+201C>poor<U+201D>) to 4 (<U+201C>excellent<U+201D>)

SRHS$srhs <- 5 - SRHS$srhs

out <- lmest(responsesFormula = srhs ~ NULL,
             index = c("id","t"),
             data = SRHS,
             k = 3,
             modBasic = 1,
             out_se = FALSE)
            
out.se <- se(out)

out1 <- lmest(responsesFormula = srhs ~ NULL,
              index = c("id","t"),
              data = SRHS,
              k = 3,
              modBasic = 1,
              out_se = TRUE)
            
out1.se <- se(out1)

# LM model for categorical responses with covariates on the latent model

out2 <- lmest(responsesFormula = srhs ~ NULL,
              latentFormula =  ~
              I(gender - 1) +
              I( 0 + (race == 2) + (race == 3)) +
              I(0 + (education == 4)) +
              I(0 + (education == 5)) +
              I(age - 50) + I((age-50)^2/100),
              index = c("id","t"),
              data = SRHS,
              k = 2,
              paramLatent = "multilogit",
              start = 0)
              
out2.se <- se(out2)

# LM model for continous responses without covariates 

require(mmm)
data(multiLongGaussian)

t <- rep(1:4, times  = max(multiLongGaussian$ID))
multiLongGaussian <- data.frame(t = t, multiLongGaussian)

# LM model for continous responses without covariates 

out3 <- lmestCont(responsesFormula = resp1 + resp2 ~ NULL,
                  index = c("ID", "t"),
                  data = multiLongGaussian,
                  k =3,
                  modBasic = 1,
                  tol = 10^-5)
                  
out3.se <- se(out3)

# LM model for continous responses with covariates 

out4 <- lmestCont(responsesFormula = resp1 + resp2 ~ NULL,
                  latentFormula = ~ X + time | X + time,
                  index = c("ID", "t"),
                  data = multiLongGaussian,
                  k = 3,
                  output = TRUE)
                  
out4.se <- se(out4)
# }

Run the code above in your browser using DataLab