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

View source: R/cateNelsonFixedY.r

cateNelsonFixedYR Documentation

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"
)

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".

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.

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.

Author(s)

Salvatore Mangiafico, mangiafico@njaes.rutgers.edu

References

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

See Also

cateNelson

Examples

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)


rcompanion documentation built on May 29, 2024, 8:42 a.m.