% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/g_function.R
\name{get_g_functions}
\alias{get_g_functions}
\title{Get g-functions}
\usage{
get_g_functions(object)
}
\arguments{
\item{object}{Object of class \link{policy_eval} or \link{policy_object}.}
}
\value{
List of class \link{nuisance_functions}.
}
\description{
\code{get_g_functions()} returns a list of (fitted) g-functions
associated with each stage.
}
\examples{
### Two stages:
d <- sim_two_stage(5e2, seed=1)
pd <- policy_data(d,
                  action = c("A_1", "A_2"),
                  baseline = c("B"),
                  covariates = list(L = c("L_1", "L_2"),
                                    C = c("C_1", "C_2")),
                  utility = c("U_1", "U_2", "U_3"))
pd

# evaluating the static policy a=1 using inverse propensity weighting
# based on a GLM model at each stage
pe <- policy_eval(type = "ipw",
                  policy_data = pd,
                  policy = policy_def(1, reuse = TRUE, name = "A=1"),
                  g_models = list(g_glm(), g_glm()))
pe

# getting the g-functions
g_functions <- get_g_functions(pe)
g_functions

# getting the fitted g-function values
head(predict(g_functions, pd))
}
\seealso{
\link{predict.nuisance_functions}
}
