analyze: Categorical Analysis of AIM Data

View source: R/analyzing.R

analyzeR Documentation

Categorical Analysis of AIM Data

Description

This function takes the outputs from the functions weight() optionally passed through weight.adjust(), benchmarker(), and a TerrADat SpatialPointsDataFrame with a field for reporting units. It applies spsurvey::cat.analysis() and returns the results

Usage

analyze(
  benchmarked_points,
  point_weights,
  id_var,
  indicator_var = "indicator",
  value_var,
  weight_var = "wgt",
  x_var = "x",
  y_var = "y",
  reporting_var,
  split_var = NULL,
  conf = 80
)

Arguments

benchmarked_points

Data frame. This should be the output from apply_benchmarks() or an equivalent and must contain the variables specified in the arguments id_var, value_var, indicator_var, x_var, and x_var. If split_var is not NULL then that variable must also be in the data frame.

point_weights

Data frame. This should be the "point_weights" data frame output from weight() or an equivalent. It must contain the variables specified in the arguments weights.joinfield, weights.weightfield, and weights.reportingfield.

id_var

Character string. The name of the variable in benchmarked_points and point_weights that contains the values used to join them. The relationship of point_weights:benchmarked_points must be 1:1 or 1:Many.

indicator_var

Character string. The name of the variable in benchmarked_points that contains the indicators for which there are categorical assignments in benchmarked_points$value_var.

value_var

Character string. The name of the variable in benchmarked_points that contains the categorical value assignments for the indicators appearing in benchmarked_points$indicator_var.

x_var

Character string. The name of the variable in benchmarked_points that contains the numeric values corresponding to the x coordinates (longitude) of the plots/observations.

y_var

Character string. The name of the variable in benchmarked_points that contains the numeric values corresponding to the y coordinates (latitude) of the plots/observations.

reporting_var

Character string. The name of the variable in point_weights that contains the values corresponding to the reporting unit (subpopulation) that the observations belong to.

split_var

Optional character string or character vector. The name(s) of variable(s) that analyses should be split along. This must be done if a point had more than one benchmark for an indicator, e.g. splitting along the management objective variable if two different objects had distinct benchmarks for the same indicator that covered the same plot(s).

conf

Numeric. The confidence level in percent. Defaults to 80.

wgt_var

Character string. The name of the variable in point_weights that contains the numeric weight values.

Value

A data frame with the output from spsurvey::cat.analysis()

Examples

analyze()

nstauffer/aim.analysis documentation built on Nov. 2, 2023, 12:52 a.m.