PcAux-Package / PcAux

This is the repository for the PcAux project.
GNU General Public License v3.0
4 stars 5 forks source link

PcAux


Archive Notice

PcAux development no longer uses this repository. So, the repository has been archived. You can find the new home of PcAux development at https://github.com/Statscamp/PcAux.

Below, you can find the original README information for this repository.


This is the repository for the PcAux package which was formerly called "quark."

PcAux is beta software, so please report any bugs that you encounter in the issues section of the project page. You may also leave requests for new features in the issues section.

Thank you for your interest in the PcAux project! I hope you find our software useful!

Installation

The best way to install PcAux is to use the devtools::install_github function.

  1. First, make sure that you have devtools installed on your system

  2. Next, execute the following lines:

    library(devtools)
    install_github("PcAux-Package/PcAux/source/PcAux")
  3. Finally, load PcAux and enjoy:

    library(PcAux)

If the devtools-based approach does not work, you can download one of the built tar-balls from the builds directory and manually install the package from source by executing the following lines:

    install.packages("/SAVE_PATH/PcAux_VERSION.tar.gz",
                     repos = NULL,
                     type  = "source")

Where SAVE_PATH is replaced by the (relative or absolute) file path to the location where you saved the tar-ball, and VERSION is replaced with the correct version number for the tar-ball that you downloaded.

Example

A basic missing data treatment using PcAux might look like the following:

  1. First, load and prepare your data:

    data(iris2)
    cleanData <- prepData(rawData   = iris2,
                          nomVars   = "Species",
                          ordVars   = "Petal.Width",
                          idVars    = "ID",
                          dropVars  = "Junk",
                          groupVars = "Species")
  2. Next, create a set of principal component auxiliary variables:

    pcAuxOut <- createPcAux(pcAuxData = cleanData,
                            nComps    = c(3, 2))
  3. Finally, use the principal component auxiliaries as the predictors in a multiple imputation run:

    miOut <- miWithPcAux(rawData   = iris2,
                         pcAuxData = pcAuxOut,
                         nImps     = 5)

You can also work directly with the principal component auxiliaries: