PLOT_LINEARITY {DFA.CANCOR} | R Documentation |
Plot for linearity
Description
Plots the linear, quadratic, and loess regression lines for the association between two continuous variables.
Usage
PLOT_LINEARITY(data, idv, dv, groups=NULL, groupNAME=NULL, legposition=NULL,
leginset=NULL, verbose=TRUE)
Arguments
data |
A dataframe where the rows are cases & the columns are the variables. |
idv |
The name of the predictor variable. |
dv |
The name of the dependent variable. |
groups |
(optional) The name of the groups variable in the dataframe,
|
groupNAME |
(optional) The value (level, name, or number) from the groups
variable that identifies the subset group whose data will be used
for the analyses, |
legposition |
(optional) The position of the legend, as specified by one of the
|
leginset |
(optional) The inset distance(s) of the legend from the margins as a
|
verbose |
Should detailed results be displayed in the console?
|
Value
If verbose = TRUE, the linear and quadratic regression coefficients and their statistical tests are displayed.
The returned output is a list with the regression coefficients and the plot data.
Author(s)
Brian P. O'Connor
References
Tabachnik, B. G., & Fidell, L. S. (2019). Using multivariate statistics (7th ed.). New York, NY: Pearson.
Examples
# data that simulate those from De Leo & Wulfert (2013)
PLOT_LINEARITY(data=data_CANCOR$DeLeo_2013, groups=NULL,
idv='Family_Conflict', dv='Grade_Point_Average', verbose=TRUE)
# data from Sherry (2006), ignoring the groups
PLOT_LINEARITY(data=data_DFA$Sherry_2006, groups=NULL, groupNAME=NULL,
idv='Neuroticism', dv='Conscientiousness', verbose=TRUE)
# data from Sherry (2006), group 2 only
PLOT_LINEARITY(data=data_DFA$Sherry_2006, groups ='Group', groupNAME=2,
idv='Neuroticism', dv='Conscientiousness', verbose=TRUE)