View source: R/FLXMRhyreg_het.R
| FLXMRhyreg_het | R Documentation |
Function used in flexmix M-Step to estimate hybrid model accounting for heteroscedastisity
FLXMRhyreg_het(
data,
formula = . ~ .,
formula_sigma = formula_sigma,
family = c("hyreg"),
type = NULL,
type_cont = NULL,
type_dich = NULL,
variables_both = NULL,
variables_cont = NULL,
variables_dich = NULL,
stv = NULL,
stv_sigma = NULL,
offset = NULL,
opt_method = "BFGS",
optimizer = "optim",
lower = -Inf,
upper = Inf,
...
)
data |
a |
formula |
linear model |
formula_sigma |
|
family |
default |
type |
|
type_cont |
value of |
type_dich |
value of |
variables_both |
|
variables_cont |
|
variables_dich |
character vactor; variables to be fitted only on dichotomous data. see Details of hyreg2_het |
stv |
|
stv_sigma |
|
offset |
offset as in |
opt_method |
|
optimizer |
|
lower |
lower bound for censored data. If this is used, |
upper |
upper bound for censored data. If this is used, |
... |
additional arguments for |
a model object, that can be used in hyreg2_het as input for parameter model in flexmix::flexmix()
Svenja Elkenkamp and Kim Rand
formula <- y ~ -1 + x1 + x2 + x3
formula_sigma <- y ~ x1 + x2 + x3
stv <- setNames(c(0.2,0,1,1),c(colnames(simulated_data_norm)[3:5],c("theta")))
stv_sigma <- setNames(c(0.2,0.2,0.1,1),c(colnames(simulated_data_norm)[3:5],c("(Intercept)")))
x <- model.matrix(formula,simulated_data_norm)
y <- simulated_data_norm$y
w <- 1
model <- FLXMRhyreg_het( data = simulated_data_norm,
formula = formula,
formula_sigma = formula_sigma,
family=c("hyreg"),
type = simulated_data_norm$type,
stv = stv,
stv_sigma = stv_sigma,
type_cont = "TTO",
type_dich = "DCE_A",
opt_method = "L-BFGS-B",
control = list(iter.max = 1000, verbose = 4),
offset = NULL,
optimizer = "optim",
variables_both = names(stv)[!is.element(names(stv),c("theta"))],
variables_cont = NULL,
variables_dich = NULL,
lower = -Inf,
upper = Inf,
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.