R/CoxShugart.R

Defines functions CoxShugart

Documented in CoxShugart

CoxShugart <- function(Z,R) {
  # m <- lm (z ~ x)
  # a <- as.numeric(m$coefficients[1])
  # b <- as.numeric(m$coefficients[2])
  RR <- mean(R)
  ZZ <- mean(Z)
  b <- sum((R-RR) * (Z-ZZ))/sum((Z-ZZ)^2)
  return(b)
  }

Try the polrep package in your browser

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

polrep documentation built on Jan. 5, 2024, 3:01 a.m.