Learn R Programming

NSM3 (version 1.1)

pDurSkiMa: Durbin, Skillings-Mack

Description

Function to compute the P-value for the observed Durbin, Skillings-Mack D statistic.

Usage

pDurSkiMa(x,b=NA,trt=NA,method=NA,n.mc=10000)

Arguments

Value

Returns a list with "NSM3Ch7p" class containing the following components:knumber of treatments in the datannumber of blocks in the datassnumber of treatments per blockppnumber of observations per treatmentlambdanumber of times each pair of treatments occurs together within a blockobs.statthe observed D statisticp.valupper tail P-value

Details

The data entry is intended to be flexible, so that the data can be entered in either of two ways. The following are equivalent: pDurSkiMa(x=matrix(c(1,2,3,4,5,6),ncol=2,byrow=T)) pDurSkiMa(x=c(1,2,3,4,5,6),b=c(1,1,2,2,3,3),trt=c(1,2,1,2,1,2))

Examples

Run this code
##Hollander, Wolfe, Chicken Example 7.6 Chemical Toxicity
table7.12<-matrix(nrow=7,ncol=7)
table7.12[1,c(1,2,4)]<-c(0.465,0.343,0.396)
table7.12[2,c(1,3,5)]<-c(0.602,0.873,0.634)
table7.12[3,c(3,4,7)]<-c(0.875,0.325,0.330)
table7.12[4,c(1,6,7)]<-c(0.423,0.987,0.426)
table7.12[5,c(2,3,6)]<-c(0.652,1.142,0.989)
table7.12[6,c(2,5,7)]<-c(0.536,0.409,0.309)
table7.12[7,c(4,5,6)]<-c(0.609,0.417,0.931)

pDurSkiMa(table7.12)

##or, equivalently:
x<-c(.465,.602,.423,.343,.652,.536,.873,.875,1.142,.396,.325,.609,.634,.409,.417,.987,.989,
.931,.330,.426,.309)
b<-c(1,2,4,1,5,6,2,3,5,1,3,7,2,6,7,4,5,7,3,4,6)
trt<-c(rep("A",3),rep("B",3),rep("C",3),rep("D",3),rep("E",3),rep("F",3),rep("g",3))

pDurSkiMa(x,b,trt)

Run the code above in your browser using DataLab