Type: | Package |
Title: | Propensity Score Matching for Unordered 3-Group Data |
Version: | 0.2.0 |
Maintainer: | Qiang LIU <dege857@163.com> |
Description: | You can use this program for 3 sets of categorical data for propensity score matching. Assume that the data has 3 different categorical variables. You can use it to perform propensity matching of baseline indicator groupings. The matching will make the differences in the baseline data smaller. This method was described by Alvaro Fuentes (2022) <doi:10.1080/00273171.2021.1925521>. |
License: | GPL-3 |
Depends: | R (≥ 4.2.0) |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.2.1 |
Imports: | tableone |
NeedsCompilation: | no |
Packaged: | 2024-07-22 09:03:27 UTC; liu |
Author: | Qiang LIU [aut, cre] |
Repository: | CRAN |
Date/Publication: | 2024-07-22 09:20:02 UTC |
datach
Description
Generate new data and define the data.
Usage
datach(data, x)
Arguments
data |
A data entry is required. |
x |
The 3 categorical variables that you make matches for. |
Value
A list with data.
pm3
Description
Propensity score matching for unordered 3-group data
Arguments
data |
need a dataframe |
x |
Enter the 3 categorical variables to be matched.If x is a number, it must be of type 1,2,3. |
y |
Enter the outcome variable for your study. |
covs |
Covariates. Usually the other fitted variables of the model.This is also usually the baseline variable you need to match. |
factor |
Define the categorical variables in your data. |
CALIP |
The number used to match. Usually you don't need to change it. The default is 0.5. |
Details
You can use this program for 3 sets of categorical data for propensity score matching. Assume that the data has 3 different categorical variables. You can use it to perform propensity matching of baseline indicator groupings. The matching will make the differences in the baseline data smaller.
Value
A list with data.
Examples
bc<-prematurity
#####Generate data lists and extract data
g<-pm3(data=bc,x="race",y="low",covs=c("age","lwt","ptl"),
factor=c("ui","low","smoke"))
mbc<-g[["mbc"]]
####Compare before and after matching
library(tableone)
allVars <-c("age", "lwt", "ptl")
fvars<-c("ht")
tab2 <- CreateTableOne(vars = allVars, strata = "race" ,
data = bc, factorVars=fvars,addOverall = TRUE )
print(tab2,smd = TRUE)
tab1 <- CreateTableOne(vars = allVars, strata = "race" ,
data = mbc, factorVars=fvars,addOverall = TRUE )
print(tab1,smd = TRUE)
pm3datalist
Description
Identification and formatting of data.
Usage
pm3datalist(data, x, y, covs, factor = NULL)
Arguments
data |
A data entry is required. |
x |
The 3 categorical variables that you make matches for. |
y |
Your result variable. |
covs |
Enter the relevant covariates. |
factor |
Define categorical variables. |
Value
A data.
pm3fit
Description
Generate propensity scores and generate the data to be matched.
Arguments
data |
A data entry is required. |
x |
The 3 categorical variables that you make matches for. |
y |
Your result variable. |
covs |
Enter the relevant covariates. |
factor |
Define categorical variables. |
Value
A list with data.
A data on indicators for premature newborns.
Description
A data on indicators for premature newborns.
Usage
data(prematurity)
Format
An object of class data.frame
with 189 rows and 11 columns.
Examples
data(prematurity)