R/Weight_Ni.R

Weight_Ni <-
function(y, subj){
dim = length(y)
n = length(unique(subj))
N = rep(0,n)
w = rep(0,n)
for (i in 1:n){
N[i] = length(subj[which(subj==unique(subj)[i])])
w[i] = 1/N[i]
}
W = rep(w, N)
out = list(W=W)
return(out)
}

Try the QRegVCM package in your browser

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

QRegVCM documentation built on May 1, 2019, 9:11 p.m.