Learn R Programming

MAGMA.R (version 1.0.3)

MAGMA_desc: MAGMA_desc

Description

This function provides pre- and post-matching descriptive statistics and effects.

Usage

MAGMA_desc(
  Data,
  covariates,
  group,
  step_num = NULL,
  step_var = NULL,
  filename = NULL,
  verbose = TRUE,
  covariates_ordinal = NULL,
  covariates_nominal = NULL
)

Value

A table of descriptive statistics and pairwise effects for pre- or post-matching samples.

Arguments

Data

A data frame that contains the desired variable for density plotting as well as the specified grouping variable.

covariates

A character vector specifying the variable names of the binary and metric variables for which the descriptive statistics should be computed.

group

A character (vector) specifying the groups for which differentiated statistics should be computed.

step_num

An integer specifying the number of cases to be included per group in this post matching comparison (e.g., 100). If no value is specified, pre-matching statistics are computed. Is based on the step variable of MAGMA. Optional argument.

step_var

A character specifying the name of the step variable in the data set. If no value is specified, pre matching statistics are computed. Optional argument.

filename

A character specifying the filename that the resulting Word document with the Table should have. Optional argument.

verbose

TRUE or FALSE indicating whether matching information should be printed to the console.

covariates_ordinal

A character vector specifying the variable names of the ordinal variables for which the descriptive statistics should be computed.

covariates_nominal

A character vector specifying the variable names of the nominal variables for which the descriptive statistics should be computed.

Author

Julian Urban

Details

This function enables the computation of descriptive statistics for the overall sample and specified groups. Additional, pairwise effects according to the respective scale level are computed.

Examples

Run this code
# Defining covariates
covariates_gifted <- c("GPA_school", "IQ_score", "Motivation", "parents_academic", "gender")

# Estimating pre-matching descriptive statistics and pairwise effects using
# the data set 'MAGMA_sim_data'
# Estimating statistics for grouping variable 'gifted support' (received
# giftedness support yes or no)
MAGMA_desc(Data = MAGMA_sim_data,
           covariates = covariates_gifted,
           group =  "gifted_support")


# Estimating post-matching descriptive statistics and pairwise effects using
# the data set 'MAGMA_sim_data'
# Estimating statistics for grouping variable 'gifted support' (received
# giftedness support yes or no)
# Estimating statistics for 100 cases per group
MAGMA_desc(Data = MAGMA_sim_data,
           covariates = covariates_gifted,
           group =  "gifted_support",
           step_num = 100,
           step_var = "step_gifted")

Run the code above in your browser using DataLab