Learn R Programming

rcompanion (version 2.4.36)

cateNelsonFixedY: Cate-Nelson models for bivariate data with a fixed critical Y value

Description

Produces critical-x values for bivariate data according to a Cate-Nelson analysis for a given critical Y value.

Usage

cateNelsonFixedY(
  x,
  y,
  cly = 0.95,
  plotit = TRUE,
  hollow = TRUE,
  xlab = "X",
  ylab = "Y",
  trend = "positive",
  clx = 1,
  outlength = 20,
  sortstat = "error"
)

Value

A data frame of statistics from the analysis: critical level for x, 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 number of observations that do not conform to the model, the proportion of observations that conform with 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, phi for the data divided into the groups indicated by the model, and Pearson's chi-square for the data divided into the groups indicated by the model.

Arguments

x

A vector of values for the x variable.

y

A vector of values for the y variable.

cly

= Critical Y value.

plotit

If TRUE, produces plots of the output.

hollow

If TRUE, uses hollow circles on the plot to indicate data not fitting the model.

xlab

The label for the x-axis.

ylab

The label for the y-axis.

trend

"postive" if the trend of y vs. x is generally positive. "negative" if negative.

clx

Indicates which of the listed critical x values should be chosen as the critical x value for the plot.

outlength

Indicates the number of potential critical x values to display in the output.

sortstat

The statistic to sort by. Any of "error" (the default), "phi", "fisher", or "pearson".

Author

Salvatore Mangiafico, mangiafico@njaes.rutgers.edu

Details

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.

References

https://rcompanion.org/rcompanion/h_02.html

See Also

cateNelson

Examples

Run this code
data(Nurseries)
cateNelsonFixedY(x          = Nurseries$Size,
                 y          = Nurseries$Proportion,
                 cly        = 0.70,
                 plotit     = TRUE,
                 hollow     = TRUE,
                 xlab       = "Nursery size in hectares",
                 ylab       = "Proportion of good practices adopted",
                 trend      = "positive",
                 clx        = 1,
                 outlength  = 15)

Run the code above in your browser using DataLab