Produces critical-x and critical-y values for bivariate data according to a Cate-Nelson analysis.
cateNelson(
x,
y,
plotit = TRUE,
hollow = TRUE,
xlab = "X",
ylab = "Y",
trend = "positive",
clx = 1,
cly = 1,
xthreshold = 0.1,
ythreshold = 0.1,
progress = TRUE,
verbose = TRUE,
listout = FALSE
)
A data frame of statistics from the analysis: number of observations, critical level for x, sum of squares, critical value for y, the number of observations in each of the quadrants (I, II, III, IV), the number of observations that conform with the model, the proportion of observations that conform with the model, the number of observations that do not conform to the model, the proportion of observations that do not conform to the model, a p-value for the Fisher exact test for the data divided into the groups indicated by the model, and Cramer's V for the data divided into the groups indicated by the model.
Output also includes printed lists of critical values, explanation of the values in the data frame, and plots: y vs. x; sum of squares vs. critical x value; the number of observations that do not conform to the model vs. critical y value; and y vs. x with the critical values shown as lines on the plot, and the quadrants labeled.
A vector of values for the x variable.
A vector of values for the y variable.
If TRUE
, produces plots of the output.
If TRUE
, uses hollow circles on the plot to indicate
data not fitting the model.
The label for the x-axis.
The label for the y-axis.
"postive"
if the trend of y vs. x is generally
positive. "negative"
if negative.
Indicates which of the listed critical x values should be chosen as the critical x value for the final model.
Indicates which of the listed critical y values should be chosen as the critical y value for the final model.
Indicates the proportion of potential critical x values
to display in the output. A value of 1
would display
all of them.
Indicates the proportion of potential critical y values
to display in the output. A value of 1
would display
all of them.
If TRUE
, prints an indicator of progress as for loops
progress.
If FALSE
, suppresses printed output of tables.
If TRUE
, outputs a list of data frames instead of a
a single data frame. This allows a data frame of critical
values and associated statistics to be extracted, for example
if one would want to sort by Cramer's V.
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu
Cate-Nelson analysis divides bivariate data into two groups.
For data with a positive trend, one group has a
large x
value associated with a large y
value, and
the other group has a small x
value associated with a small
y
value. For a negative trend, a small x
is
associated with a large y
, and so on.
The analysis is useful for bivariate data which don't conform well to linear, curvilinear, or plateau models.
This function will fail if either of the largest two or smallest two x values are identical.
http://rcompanion.org/rcompanion/h_02.html
Cate, R. B., & Nelson, L.A. (1971). A simple statistical procedure for partitioning soil test correlation data into two classes. Soil Science Society of America Proceedings 35, 658–660.
cateNelsonFixedY
data(Nurseries)
cateNelson(x = Nurseries$Size,
y = Nurseries$Proportion,
plotit = TRUE,
hollow = TRUE,
xlab = "Nursery size in hectares",
ylab = "Proportion of good practices adopted",
trend = "positive",
clx = 1,
xthreshold = 0.10,
ythreshold = 0.15)
Run the code above in your browser using DataLab