FactorHet-class {FactorHet} | R Documentation |
Generic methods for FactorHet models
Description
Brief descriptions of generic methods (e.g. print, summary) for FactorHet as well as a way to visualize the progress of the model-based optimization.
Usage
## S3 method for class 'FactorHet'
plot(x, y = NULL, ...)
## S3 method for class 'FactorHet'
formula(x, ...)
## S3 method for class 'FactorHet'
print(x, fusion.tolerance = 0.001, ...)
## S3 method for class 'FactorHet'
summary(object, show_interactions = FALSE, digits = 3, ...)
## S3 method for class 'FactorHet'
coef(object, coef_type = "beta", ...)
## S3 method for class 'FactorHet'
logLik(object, type = "loglik", ...)
## S3 method for class 'FactorHet'
BIC(object, ...)
## S3 method for class 'FactorHet'
AIC(object, ...)
## S3 method for class 'FactorHet_vis'
print(x, ...)
visualize_MBO(object)
posterior_FactorHet(object)
## S3 method for class 'FactorHet'
vcov(object, phi = TRUE, se.method = NULL, ...)
Arguments
x |
Model from FactorHet |
y |
Not used; required to maintain compatibility. |
... |
Optional arguments; only used by |
fusion.tolerance |
Threshold at which to declare levels fused |
object |
Object fit using |
show_interactions |
Used by |
digits |
Number of digits to include |
coef_type |
Type of coefficient (beta for treatment effects; phi for moderators) |
type |
For "logLik", should the log-likelihood ( |
phi |
A logical value indicating whether the standard errors from the
moderator parameters, |
se.method |
A string value for the type of standard errors to be
computed. The default, and primary option, is |
Details
The following methods with the arguments given above exist. All
methods work on models with using FactorHet
and
FactorHet_mbo
.
- plot:
This is a shorthand for
cjoint_plot
on a fitted object.- formula:
This returns the underlying formula for the treatment effects and moderators as a named list. This also returns the values used for
group
,task
, andchoice_order
if provided.- print:
This consists of two
print
methods. ForFactorHet
, it summarizes the model and fusion of the factor levels.fusion.tolerance
sets the threshold at which levels are reported as fused. For outputs ofAME
(and similar), this plots the corresponding plot. See that documentation for more details.- summary:
This summarizes the main effects by group with standard errors. It is typically more common to visualize this with
cjoint_plot
(and the accompanying data.frame) orAME
.show_interactions = TRUE
shows the interactions in addition to the main effects.- coef:
This returns the coefficient matrix on the original scale (i.e. with the sum-to-zero constraints).
code_type = "phi"
returns the moderator coefficients instead of the treatment effect coefficients.- AIC and BIC:
This returns the AIC or BIC. If multiple degrees of freedom options specified, it returns a matrix.
- logLik:
This returns the log-likelihood, log-posterior or sequence of log-posterior values at each iteration of the algorithm. The argument
"type"
provides more details.- visualize_MBO:
For a model fit with
FactorHet_mbo
, this shows information about the MBO, i.e. proposed values and objectives.- posterior_FactorHet:
For a model with
K > 1
, this visualizes the posterior for each observation and the posterior predictive implied by the moderators.- vcov.FactorHet
This extracts the estimated variance-covariance matrix of the parameters.
Value
Returns the corresponding output of the generic method. "Details" provides details on the output of each function.
References
Louis, Thomas A. 1982. "Finding the Observed Information Matrix when Using the EM Algorithm." Journal of the Royal Statistical Society. Series B (Methodological). 44(2):226-233.
Goplerud, Max, Kosuke Imai, and Nicole E. Pashley. 2025. "Estimating Heterogeneous Causal Effects of High-Dimensional Treatments: Application to Conjoint Analysis." arxiv preprint: https://arxiv.org/abs/2201.01357