MyNixOS website logo
Description

Multi-Factor Curve Analysis for Grouped Data in 'R'.

Implements multi-factor curve analysis for grouped data in 'R', replicating and extending the functionality of the the 'Stata' ado 'mfcurve' (Krähmer, 2023) <https://ideas.repec.org/c/boc/bocode/s459224.html>. Related to the idea of specification curve analysis (Simonsohn, Simmons, and Nelson, 2020) <doi:10.1038/s41562-020-0912-z>. Includes data preprocessing, statistical testing, and visualization of results with confidence intervals.

mfcurve: Multi-Factor Curve Analysis in R

Overview

mfcurve is an R package designed for plotting results from multifactorial research designs (i.e. conjoint analyses, choice experiments, factorial survey experiments), replicating and enhancing the functionality of the Stata mfcurve ado file by Daniel Krähmer. The package provides a streamlined workflow for:

  • Preprocessing data to create grouped summaries.
  • Conducting statistical tests to compare group means and assess significance.
  • Generating visualizations to explore differences across groups, including confidence intervals and significance markers.

This package is ideal for researchers and analysts working with factorial survey experiments, conjoint analysis, or other multi-factor designs.

Features

  • Data Preprocessing: Easily group data by multiple factors or predefined group variables.
  • Statistical Testing: Compare group means using t-tests, with flexible options for confidence levels.
  • Visualization: Create publication-ready plots highlighting group differences and significant results.

Installation

To install the package from GitHub, follow these steps:

# Install devtools if not already installed
install.packages("devtools")

# Install mfcurve package from GitHub
devtools::install_github("XAM12/mfcurve_R")

Usage

Here’s a quick guide on how to use mfcurve:

1. Preprocess Data

library(mfcurve)

# Example dataset
data <- data.frame(
  outcome = rnorm(100),
  factor1 = factor(sample(letters[1:3], 100, replace = TRUE)),
  factor2 = factor(sample(letters[4:5], 100, replace = TRUE))
)

# Preprocess data with two factors
preprocessed_data <- mfcurve_preprocessing(data, outcome = "outcome", factors = c("factor1","factor2"))

2. Visualize Results

plot <- mfcurve_plotting(
  group_stats_vis = preprocessed_data$group_stats_vis,
  lower_data      = preprocessed_data$lower_data,
  grand_mean      = preprocessed_data$grand_mean,
  outcome         = "outcome",
  factors         = c("factor1","factor2"),
  level           = preprocessed_data$level
)
print(plot)

Example Plot

Documentation

Detailed documentation for each function is available within R:

?mfcurve
?mfcurve_plotting
?mfcurve_preprocessing

Vignette

For a comprehensive guide on using mfcurve, refer to the vignette:

vignette("mfcurve-intro")

Contributing

Contributions are welcome! If you find bugs or have suggestions, feel free to open an issue or submit a pull request on GitHub.

License

This package is licensed under GNU General Public License v3.0 or later. See the LICENSE on GitHub for more details: https://github.com/XAM12/mfcurve_R/blob/main/LICENSE.md

Contact

For questions or suggestions, please contact:

Metadata

Version

1.0.2

License

Unknown

Platforms (78)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows