correxp: correxp function

View source: R/correxp.R

correxpR Documentation

correxp function

Description

This function calcualtes standardized mean difference in variable(s) in a matched dataset.

Usage

correxp(
  data,
  bexp,
  cexp,
  exp.status = 1,
  varinames = NULL,
  weightname = NULL,
  method = "Pearson"
)

Arguments

data

a dataset object.

bexp

a character string indicating the name of the binary exposure. Use apostrophe like "VariableName"

cexp

a character string indicating the name of the continuous exposure. Use apostrophe like "VariableName"

exp.status

a numeric vector indicating the value indicating exposed units. Defalut=1

varinames

a vector of variable names for which you wish to calculate standardized mean difference. List variable names as a vector like c("VariableA","VariableB")

weightname

the name of the weight variable. This weight is calculated by cgps.match. See cgps.match function. If NULL, weight is not given (i.e., all observations are equally weighted)

method

a character string indicating which correlation coefficient is to be computed. These include "Pearson" (default), "Spearman", "Polychoric", or "Polyserial". For tetrachoric use "Polychoric" and for biserial use "Polyserial". This relies on wCorr::weightedCorr

Examples

correxp(test.dat,"exposure","exp_cons",exp.status=1,varinames=c("X1","X2","X3","U"),weightname="weight",method="Pearson")
correxp()

HonghyokKim/CGPSspatialmatch documentation built on April 24, 2022, 9:10 p.m.