Files
SPT/man/select_weight.Rd

35 lines
1.2 KiB
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/select_weight.R
\name{select_weight}
\alias{select_weight}
\title{Compute confounding weights for the PCBSM.}
\usage{
select_weight(
df = NULL,
grp = NULL,
X = NULL,
instr = NULL,
type.res = "deviance",
std = F
)
}
\arguments{
\item{df}{data.frame containing the data}
\item{grp}{string containing the name of the column where the group membership variable is stored in df}
\item{X}{vector of strings containing the name of confounders to be included in the model}
\item{instr}{vector of strings containing the name of instrumental variables to be included in the model}
\item{type.res}{string containing the type of glm residuals to be used. Default is "deviance"}
\item{std}{boolean indicating whether residuals should be standardized. Default is TRUE}
}
\value{
A vector of weights to be included in a PCBSM
}
\description{
This function computes weights to be included in a PCBSM as a covariate accounting for unobserved confounding. Obtained by extracting response residuals from a probit model with grp as dependent variable and confounders and instruments as independent variables.
}