% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/prepare_base_char_subgroup.R
\name{prepare_base_char_subgroup}
\alias{prepare_base_char_subgroup}
\title{Prepare data for treatment compliance table}
\usage{
prepare_base_char_subgroup(
  meta,
  population,
  analysis = "base_char_subgroup",
  parameter,
  subgroup_var,
  subgroup_header = c(meta$population[[population]]$group, subgroup_var)
)
}
\arguments{
\item{meta}{A metadata object created by metalite.}

\item{population}{A character value of population term name.
The term name is used as key to link information.}

\item{analysis}{A character value of analysis term name.
The term name is used as key to link information.}

\item{parameter}{A character value of parameter term name.
The term name is used as key to link information.}

\item{subgroup_var}{A character value of subgroup variable name in
observation data saved in \code{meta$data_observation}.}

\item{subgroup_header}{A character vector for column header hierarchy.
The first element will be the first level header and the second element
will be second level header.}
}
\value{
A list of analysis raw datasets.
}
\description{
Prepare data for treatment compliance table
}
\examples{
meta <- metalite::meta_adam(
  population = metalite_sl_adsl,
  observation = metalite_sl_adsl
) |>
  metalite::define_plan(metalite::plan(
    analysis = "base_char_subgroup",
    population = "apat",
    observation = "apat",
    parameter = "age"
  )) |>
  metalite::define_population(
    name = "apat",
    group = "TRTA",
    subset = SAFFL == "Y"
  ) |>
  metalite::define_parameter(
    name = "age",
    var = "AGE",
    label = "Age (years)",
    vargroup = "AGEGR1"
  ) |>
  metalite::define_analysis(
    name = "base_char_subgroup",
    title = "Participant by Age Category and Sex"
  ) |>
  metalite::meta_build()

outdata <- prepare_base_char_subgroup(
  meta,
  population = "apat",
  parameter = "age",
  subgroup_var = "TRTA",
  subgroup_header = c("SEX", "TRTA")
)
}
