local_association | R Documentation |
Subroutines called by lassie
to compute
local and global association measures from a list of probabilities.
local_association(x, measure = "chisq", nr = 1)
lewontin_d(x)
duchers_z(x)
pmi(x, normalize)
chisq(x, nr)
x |
list of probabilities as outputted by |
measure |
name of measure to be used:
|
nr |
number of rows/samples. Only used to estimate chi-squared residuals. |
normalize |
0 for pmi, 1 for npmi, 2 for npmi2 |
List containing the following values:
local: local association array (may contain NA, NaN and Inf values).
global: global association numeric value.
lassie
# This is what happens behind the curtains in the 'lassie' function
# Here we compute the association between the 'Girth' and 'Height' variables
# of the 'trees' dataset
# 'select' and 'continuous' take column numbers or names
select <- c('Girth', 'Height') # select subset of trees
continuous <-c(1, 2) # both 'Girth' and 'Height' are continuous
# equal-width discretization with 3 bins
breaks <- 3
# Preprocess data: subset, discretize and remove missing data
pre <- preprocess(trees, select, continuous, breaks)
# Estimates marginal and multivariate probabilities from preprocessed data.frame
prob <- estimate_prob(pre$pp)
# Computes local and global association using Ducher's Z
lam <- local_association(prob, measure = 'z')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.