npplots: Generate Normal Probability Plots and Detrended Normal Plots

View source: R/npplots.r

npplotsR Documentation

Generate Normal Probability Plots and Detrended Normal Plots

Description

Creates normal probability plots (NNPLOT) and detrended normal probability plots for each numeric variable in the input dataset. These plots are useful for assessing normality of variables and identifying potential deviations from normality.

Usage

npplots(data)

Arguments

data

A data frame containing numeric variables to be analyzed

Details

For each numeric variable, the function creates two plots: 1. Normal Probability Plot (NNPLOT): Plots observed values against their expected normal values, with a reference line showing perfect normality 2. Detrended Normal Plot: Shows deviations from normality by plotting residuals from the normal probability line against observed values

The function automatically: * Identifies and processes only numeric columns * Calculates normal scores and z-scores * Creates side-by-side plots for each variable * Resets the plotting parameters after completion

Value

No return value. Generates plots directly to the current graphics device.

Examples

# Create plots for all numeric variables in mtcars
npplots(mtcars)

# Create plots for a single numeric variable
npplots(data.frame(x = rnorm(100)))


ccamp83/mu documentation built on Nov. 7, 2024, 5:17 p.m.