data(SKAT.example)
Z<-SKAT.example$Z
# continuous trait
obj<-SKAT_Null_Model(y.c ~ X, out_type="C", data=SKAT.example)
SKAT_CommonRare(Z, obj)$p.value
SKAT_CommonRare(Z, obj, method="A")$p.value
SKAT_CommonRare(Z, obj, method="AR")$p.value
# dichotomous trait
obj<-SKAT_Null_Model(y.b ~ X, out_type="D", data=SKAT.example)
# Combined sum test in the manuscript (SKAT-C and Burden-C)
SKAT_CommonRare(Z, obj)$p.value
SKAT_CommonRare(Z, obj, r.corr.rare=1, r.corr.common=1 )$p.value
# Test only with common variant
SKAT_CommonRare(Z, obj, test.type="Common.Only")$p.value
# Test only with rare variant
SKAT_CommonRare(Z, obj, test.type="Rare.Only")$p.value
# Use CommonRare_Cutoff=0.01 instead of CommonRare_Cutoff = NULL
SKAT_CommonRare(Z, obj, CommonRare_Cutoff=0.01)$p.value
# Use custom weights; the first 10 variants have higher weights
weights<-rep(1,67); weights[1:10]<-2
SKAT_CommonRare(Z, obj, weights=weights)$p.value
Run the code above in your browser using DataLab