clus.rho.g: Calculate A Common Intracluster Correlation Coefficient Among...

View source: R/clus.rho.g.R

clus.rho.gR Documentation

Calculate A Common Intracluster Correlation Coefficient Among Groups

Description

Calculates a common intracluster correlation coefficients according to Donner (1986: 77-79) for two or more groups with unequal cluster sizes, and tests for homogeneity of residual error among groups and a common coefficient among groups.

Usage

 clus.rho.g(popchar=NULL, cluster = NULL, group = NULL)

Arguments

popchar

vector containing containing the population characteristic (e.g., length, weight, etc.). One line per individual.

cluster

vector containing the variable used to identify the cluster. Identifier can be numeric or character.

group

vector containing the identifier used for group membership of length data. This variable is used to determine the number of groups. Identifier can be numeric or character.

Details

The intracluster correlation coefficient (rho) provides a measure of similarity within clusters. rho is calculated using a one-way nested random effects model (Donner, 1986: 77-79). The formula is

rho = (BMS-WMS)/(BMS+(m-1)*WMS)

where BMS is the mean square among clusters within groups, WMS is the mean square within clusters and m is the adjusted mean cluster size for clusters with unequal sample sizes. All clusters with zero elementary units should be deleted before calculation. In addition, approximate 95 are generated and a significance test is performed.

Bartlett's test is used to determine if mean square errors are constant among groups. If Bartlett's test is not significant, the test for a common correlation coefficient among groups is valid.

Value

rho value and associate statistics

Author(s)

Gary A. Nelson, Massachusetts Division of Marine Fisheries gary.nelson@mass.gov

References

Donner, A. 1986. A review of inference procedures for the intraclass correlation coefficient in the one-way random effects model. International Statistical Review. 54: 67-82.

See Also

clus.str.lf clus.lf clus.mean

Examples

  data(codcluslen)
   temp<-codcluslen[codcluslen$number>0,]
   temp$station<-c(paste(temp$region,"-",temp$tow,sep=""))
   total<-aggregate(temp$number,list(temp$station),sum)
   names(total)<-c("station","total")
   temp<-merge(temp,total,by.x="station",by.y="station")
   newdata<-data.frame(NULL)
   for(i in 1:as.numeric(length(temp[,1]))){
    for(j in 1:temp$number[i]){
     newdata<-rbind(newdata,temp[i,])
    }
  }
  newdata<-newdata[,-c(5)]
 clus.rho.g(popchar=newdata$length,cluster=newdata$station,group=newdata$region)

fishmethods documentation built on April 27, 2023, 9:10 a.m.