Learn R Programming

prcr (version 0.1.5)

cross_validate: Returns statistics from double-split cross validation

Description

Returns statistics from double-split cross validation

Usage

cross_validate(df, ..., to_center = FALSE, to_scale = FALSE, n_profiles,
  distance_metric = "squared_euclidean", linkage = "complete", k = 30,
  lower_bound = 2, upper_bound = 9)

Arguments

df

with two or more columns with continuous variables

...

unquoted variable names separated by commas

to_center

(TRUE or FALSE) for whether to center the raw data with M = 0

to_scale

Boolean (TRUE or FALSE) for whether to scale the raw data with SD = 1

n_profiles

the number of profiles in the solution to cross-validate; or, the character string "iterate" to perform cross-validation for 2 to 9 profile solutions

distance_metric

Distance metric to use for hierarchical clustering; "squared_euclidean" is default but more options are available (see ?hclust)

linkage

Linkage method to use for hierarchical clustering; "complete" is default but more options are available (see ?dist)

k

the number of iterations

lower_bound

if n_profiles = "iterate", then this is the smallest number of profiles in the range of number of profiles to explore; defaults to 2

upper_bound

if n_profiles = "iterate", then this is the largest number of profiles in the range of number of profiles to explore; defaults to 9

Value

A ggplot2 object

Details

Performs double-split cross validation and returns Cohen's Kappa and percentage agreement statistics.