Skip to contents

Creates a concise tabular summary of a projoint_results object, including the chosen estimand, analysis structure, standard-error settings, and a data frame of estimates.

Usage

# S3 method for class 'projoint_results'
summary(object, ...)

Arguments

object

An object of class projoint_results.

...

Additional arguments (ignored).

Value

A data frame (often a tibble) summarizing the estimated effects. At minimum, it contains the columns produced in object$estimates (e.g., attribute/level identifiers and the point estimate with its standard error and confidence interval in columns such as estimate, std.error, conf.low, conf.high). This table is suitable for further processing or printing.

Examples

# \donttest{
  data(exampleData1)

  # Reshape data for two base tasks + repeated (for IRR estimation)
  dat <- reshape_projoint(
    exampleData1,
    .outcomes = c("choice1", "choice2", "choice1_repeated_flipped")
  )

  # Build a valid choice-level QoI
  att <- unique(dat$labels$attribute_id)[1]
  lev_ids   <- dat$labels$level_id[dat$labels$attribute_id == att]
  lev_names <- sub(".*:", "", lev_ids)

  q <- set_qoi(
    .structure     = "choice_level",
    .estimand      = "mm",
    .att_choose    = att,
    .lev_choose    = lev_names[2],
    .att_notchoose = att,
    .lev_notchoose = lev_names[1]
  )

  # Fit model
  fit <- projoint(dat, .qoi = q)

  # Get the tabular summary of estimates
  tab <- summary(fit)
#> 
#> Summary of Projoint Estimates
#> ------------------------------
#> Estimand: mm
#> Structure: choice_level
#> Standard error method: analytical
#> SE type (lm_robust):   CR2 (clustered by id)
#> IRR: Estimated
#> Tau: 0.172
#> 
  head(tab)
#> # A tibble: 2 × 7
#>   estimand       estimate     se conf.low conf.high att_level_choose
#>   <chr>             <dbl>  <dbl>    <dbl>     <dbl> <chr>           
#> 1 mm_uncorrected    0.406 0.0361    0.334     0.477 att1:level2     
#> 2 mm_corrected      0.356 0.0551    0.247     0.465 att1:level2     
#> # ℹ 1 more variable: att_level_notchoose <chr>
# }