Hello!
Quick query: when we run a logit model, we get the following result:
Null deviance: 10113.8 on 7718 degrees of freedom
Residual deviance: 9601.4 on 7706 degrees of freedom
What are these "deviances", and what are the two different numbers for degrees
of freedom? Which is more useful to report?
Many thanks.
Best,
Dan
Dear all,
Let's make a deal. I kinda know R, you kinda know STATA. I need a
half-hour of help...and will help you in return. Anytime Saturday or
Sunday afternoon.
I need to install one of Gary's software packages into STATA, load/clean
some data, and run two models. I know exactly the steps I need to do, but
have no idea how to use STATA.
Please email me privately if you're willing to deal.
Yours,
Olivia.
Happy Spring Break, everybody!
One of the values we are trying to replicate from a table is "Pseudo R^2"
for a logit model. What is this, and how can we calculate it? Or can
we skip replicating it, since we've been able to replicate all the
coefficients and errors in the table?
Thanks,
Anna
Dear Kosuke,
I was trying to get your homework 5 code to work (the optim() for the
logit under #2), but I get the following error message:
> check <- optim(start2, log.lik, method = "BFGS", X = X2, Y = Y, control
= list(finscale = -1))
Error in...
non-finite, finite-difference value [15]
I have my X2 and Y set up exactly as you do in the homework, and I'm using
your version of the log.lik function. This error message goes away when I
change the log.like function from
-sum(log(1 + exp((1 - 2 * Y) * X %*% par)) (1)
to
sum(log(1 + exp((1 - 2 * Y) * X %*% par)) (2)
But I know from the notes that (1) is correct. Help!!!!!
Thanks,
Olivia.
Dear all,
Asif and I are trying to run a weighted logit, and we are using:
glm(...., weights = c(w), family = (bniomial(link=logit))
where w is a vector of weights (and in the data frame). The error message
is:
non-integer #successes in a binomial glm! in:eval(expr, envr, enclos)
I've tried everying...including consuting Dan Ho. Any suggestions?
Thanks,
Olivia.
This package might be helpful as many people are trying to replicate the
results with "robust" standard errors. To install packages from CRAN, you
need to do the following
1. In your home directory,
mkdir .R
to create a directory for R
2. Open .cshrc file in your home directory, and define the R library
directory by adding the following line at the end of the file.
setenv R_LIBS=~/.R/library
3. Read the modified file.
source .cshrc
4. Now start R and type
options(CRAN ="http://cran.us.r-project.org/")
install.packages("car")
5. Finally, to use this package, type
library("car")
Kosuke
On Fri, 21 Mar 2003, Nirmala Ravishankar wrote:
> According to R-Help, there is a package car that has a function that
> calculates White robust standard errors. We downloaded the zipped file,
> gunzipped the tar.gz file, but are unable to use R CMD INSTALL to install
> the .tar file.
>
> Have either of you installed car before?
>
> http://cran.r-project.org/src/contrib/PACKAGES.html
>
>
> best,
> nirmala
>
>
>
>
>
> **********************************************************************
> Nirmala Ravishankar
> First Year Graduate Student,
> Government Department,
> Harvard University
>
>
Hey all,
How does one unsuspend processes on the ice sessions?
Nathan A. Paxton, Ph.D. Student
Dept. of Government
M-22 Littauer Hall
Harvard University
Cambridge, Massachusetts 02138
___________________________________
PLEASE NOTE NEW E-MAIL ADDRESS!
napaxton(a)fas.harvard.edu
========================================================================
The most courageous act is still to think for yourself. Aloud.
- Coco Chanel
========================================================================
Dear Class,
My group is trying to run an ordered logit model in R. Here is our code:
answer<-polr(factor(REPSTRAT.NEW,ordered=T)~COMP + EV + TVADCOST +
+DUMMY92 + DUMMY96 + COMP:EV + COMP:TVADCOST, data=jop2, Hess=T)
And here is a summary of that model:
Call:
polr(formula = factor(REPSTRAT.NEW, ordered = T) ~ COMP + EV +
TVADCOST + +DUMMY92 + DUMMY96 + COMP:EV + COMP:TVADCOST,
data = jop2, Hess = T)
Coefficients:
Value Std. Error t value
COMP 0.381690950 NaN NaN
EV 0.385280417 NaN NaN
TVADCOST 2.122405681 NaN NaN
DUMMY92 1.358449382 0.44851339 3.0287822
DUMMY96 0.022861550 0.44520948 0.0513501
COMP:EV -0.007813632 NaN NaN
COMP:TVADCOST -0.057424499 0.01810358 -3.1719977
Intercepts:
Value Std. Error t value
0|1 18.1371 NaN NaN
1|2 19.5694 NaN NaN
Residual Deviance: 236.1473
AIC: 254.1473
Warning message:
NaNs produced in: sqrt(diag(vc))
Does anyone know why we might be getting NaN for std errs and t values? I
believe it has something to do with the interaction terms, since I don't
get NaN's when I omit the interactions.
Any assistance would be greatly appreciated.
Andrew
--
Andrew Reeves
reeves(a)fas.harvard.edu
617.493.3485 tel.
301.639.8369 cell.
http://people.fas.harvard.edu/~reeves/
Hi all,
Today's section materials are available on the course website. I'll be
out of town from tomorrow until the end of the break, but will be
available through e-mail for most of time. If you have any questions about
homeworks and paper, don't hesitate to drop me a line.
Have a good break and replication!
Kosuke
This is a multi-part message in MIME format.
------=_NextPart_000_004B_01C2ED9E.26611EF0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I have a bit of a problem--if somebody could explain, it would be very =
helpful.
1. i did probit and logit on the data (just by switching the link in =
the glm) and came up with totally different coefficients. I thought =
they were supposed to be similar? Is this a problem?
2. when I calculated fitted values using substitution and my =
coefficients, I came up with an answer for both the probit and logit =
that was bigger than a probability (like -2.5 and -1.5). is this =
because the effect of the coefficient is on Y* and not on the observed =
DV y_i? Is it "okay" to get an answer like -2.5?
Traci
------=_NextPart_000_004B_01C2ED9E.26611EF0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2719.2200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I have a bit of a problem--if somebody =
could=20
explain, it would be very helpful.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>1. i did probit and logit on the =
data (just=20
by switching the link in the glm) and came up with totally different=20
coefficients. I thought they were supposed to be similar? Is =
this a=20
problem?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>2. when I calculated fitted =
values using=20
substitution and my coefficients, I came up with an answer for both the =
probit=20
and logit that was bigger than a probability (like -2.5 and -1.5). =
is this=20
because the effect of the coefficient is on Y* and not on the observed =
DV=20
y_i? Is it "okay" to get an answer like -2.5?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Traci</FONT></DIV></BODY></HTML>
------=_NextPart_000_004B_01C2ED9E.26611EF0--