partialr | R Documentation |
Simulated data set used to demonstrate added-variable and component + residual plots
partialr
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)
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).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.