Learn R Programming

netjack (version 1.2.0)

group_test: Group test

Description

This function implements the group test on a network statistic. This test assesses if the network statistic is significantly different between groups, at each network manipulation.

Usage

group_test(netSampleStatSet, grouping.variable, p.adjust = "none",
  non.parametric = F)

Arguments

netSampleStatSet

Input NetSampleStatSet

grouping.variable

character name of sample level grouping variable

p.adjust

character string for requested multiple comparisons adjustment. Defaults to none.

non.parametric

Logical. if true, test is performed using Wilcox test. If false, t-test. Defaults to false.

Value

A data frame containing original and adjusted p.values.

Details

If the sample has 2 groups, this test is performed using a t-test or Wilcox test. If the sample has 3 or more groups, the test is performed using a 1-way ANOVA, or Kruskal-Wallis test. Differences are tested at each network manipulation.

Examples

Run this code
# NOT RUN {
data(GroupA)
GroupA_Net = as_NetSample(GroupA, 1:20, node.variables = list(community = c(rep(1, 10), rep(2,10))),
  sample.variables = list(group = c(rep(1, 10), rep(2,10))))
Jackknife_GroupA_Net = net_apply(GroupA_Net, node_jackknife)
GlobEff_GroupA_Net = net_stat_apply(Jackknife_GroupA_Net, global_efficiency)
group_test(GlobEff_GroupA_Net, grouping.variable = "group")
# }

Run the code above in your browser using DataLab