npplots | R Documentation |
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.
npplots(data)
data |
A data frame containing numeric variables to be analyzed |
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
No return value. Generates plots directly to the current graphics device.
# Create plots for all numeric variables in mtcars
npplots(mtcars)
# Create plots for a single numeric variable
npplots(data.frame(x = rnorm(100)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.