Displaying 1 result from an estimated 1 matches for "hw4econ3".
2012 Nov 12
1
Invalid 'times' argument three-category ordered probit with maximum likelihood
...ons. Econ3 is a 1-3
rating and partyid is a range from -3(Strong Democrat) to 3 (Strong
Republican). Here is the code I used:
setwd("C:/Users/Terry/Desktop/Terry/School/Fall 2012/ML/HW")
#Load Libraries
library(MASS)
library(tile)
library(simcf)
#Load Data
econrate <- read.csv("hw4econ3.csv", header=TRUE, sep=",")
attach(econrate)
#Ordered Probit Liklihood
llk.oprobit3 <- function(param, x, y) {
os <- rep(1, nrow(x))
x <- cbind(os, x)
b <- param[1:ncol(x)]
t2 <- param[(ncol(x)+1)]
xb <- x%*%b
p1 <- log(pnorm(-xb))
if (t2<=0) p...