R/define.grps.R

Defines functions define.grps

# define.grps: Function defines the lesion groups to be included in the Kruskal-Wallis test.
# Lesion groups with fewer subjects than specified by min.grp.size are excluded from the test.
# At least two eligible groups must remain for the Kruskal-Wallis test; otherwise one.KW.pvalue returns NA.

define.grps=function(grps,               # Lesion groups
                     min.grp.size=NULL)  # minimum number of subjects in the lesion group to be included in the KW test.
{
  grp.tbl=table(grps)
  small.grp=(grp.tbl<min.grp.size)
  exclude.grp=grps%in%(names(grp.tbl)[small.grp])
  grps[exclude.grp]="EXCLUDE"
  return(grps)
}

Try the GRIN2 package in your browser

Any scripts or data that you put into this service are public.

GRIN2 documentation built on Aug. 22, 2026, 5:09 p.m.