search for: harvar

Displaying 1 result from an estimated 1 matches for "harvar".

Did you mean: harvard
2003 Sep 08
1
Probit and optim in R
...x1 + x2)$coef result<-optim(values.start, llik.probit, gr=grad, Y=Y, X=X, method="BFGS", control=list(maxit=2000, fnscale=-1, trace), hessian=T) na[j,] <-result$par j <- j+1 } ## Probit with Real Data #Define Data data<-read.table("c:/mydocu~1/harvar~1/snct.dat", header=T) y <- data$MIL x <- cbind(rep(1, length(y)), data$COOP, data$TARGET, data$COST, data$RELAT) #Form Likelihood llik.probit<-function(par, X, Y){ Y <- as.matrix(y) X <- as.matrix(x) K <- ncol(X) b <- as.matrix(par[1:K]) phi<-pnorm(X%*%b) sum(Y*...