partialr: partialr

partialrR Documentation

partialr

Description

Simulated data set used to demonstrate added-variable and component + residual plots

Usage

partialr

Format

A data frame with 100 rows and 4 variables:

x1

predictor simulated using x1 = runif(100, -5, 5)

x2

predictor simulated using x2 = 0.5*x1 + rnorm(100, 0, 2)

x3

predictor simulated using x3= rnorm(100, 0, 3)

x4

predictor simulated using x4 = x1*0.7 + rnorm(100, 0, 4)

y

response variable simulated using y = x1*1.5 - 1.2*x2 + 0.5*x3 -0.8*x3^2 + rnorm(100, 0, 5)

Source

Data were simulated so that y has a linear relationship with x1, a quadratic relationship with x2, and a spurious relationship with x3 (due to its correlation with x1).


jfieberg/Data4Ecologists documentation built on April 17, 2025, 3:12 p.m.