Dear all,
On p. 3 of the lecture notes, Gary gives 1/(1 + exp(-Xi %&%
beta), but on p. 5 he gives 1/(1 + exp(X %*% beta).
Is the exp() terms supposed to be negative or positive?
Thanks,
Olivia.
I used glm and stored the result in a variable called "result". In order
to extract sigma I'm doing the following:
summary(result)$sigma
but this is giving me null. am I calling it wrong or could I be doing
calling something wrong when I run glm itself?
thanks.
~mee-jung
I know this has been asked before, but how do you keep smooth fonts what
you convert a dvi file to pdf?
Andrew
--
--
Andrew Reeves
reeves(a)fas.harvard.edu
617.493.3485 tel.
301.639.8369 cell.
http://people.fas.harvard.edu/~reeves/
just as a clarification, when one implements:
1-pchisq(blah blah blah)
What is the value we get? Is it the likelihood that the Null is correct? Or
is it the likelihood that the Null is not correct??
Thanks,
Phillip.
-------------------------------------------------
Phillip Y. Lipscy
Perkins Hall Room #129
35 Oxford Street
Cambridge, MA 02138
(617)493-4893 DORM
(617)851-8220 CELL
lipscy(a)fas.harvard.edu
http://www.people.fas.harvard.edu/~lipscy/
First Year Student, Ph.D. Program
Harvard University, FAS, Department of Government
-------------------------------------------------
You can use whatever command you like. But, if you are going to do the
simulation for the first differences, you will end up calculating two sets
of fitted values.
Kosuke
---------- Forwarded message ----------
Date: Tue, 18 Mar 2003 16:52:35 -0500 (EST)
To: Kosuke Imai <kimai(a)fas.harvard.edu>
Subject: HW5 #2
Kosuke:
To calculate the fitted values in number 2 on the homework, can we simply
utilize the R command "fitted", or do you want us to write some function
that effectively manually calculates all of the fitted values?
Thanks,
Dear Class,
Several of us are getting consistently strange results on Q1, and I was curious
if people had any thoughts.
When we run the optim function, we get the following printout:
> result2 <- optim(c(45,0.06,1.37,3.67,4.14), llik.1, method="BFGS",
hessian=T, control=list(fnscale=-1))
> result2
$par
[1] 45.00268155 -0.07857318 1.37203622 3.66731845 4.14000000
1. While some of these coefficients are pretty close, the final one is exactly
what we fed into optim. (THe order is the same as in the assignment:
intercept, ADAACA, JULYECQ2, INC, HOME4.) None match the LM results exactly.
$value
[1] -5528994
$counts
function gradient
15 3
$convergence
[1] 0
$message
NULL
$hessian
[,1] [,2] [,3] [,4] [,5]
[1,] -59.06099 3052.870 -44.88649 59.06099 0
[2,] 3052.86981 -157802.855 2320.18111 -3052.86981 0
[3,] -44.88649 2320.181 -34.11388 44.88649 0
[4,] 59.06099 -3052.870 44.88649 -59.06099 0
[5,] 0.00000 0.000 0.00000 0.00000 0
>
2. Notice too the row of all zeros in the Hessian. What does that mean?
Might that explain why our results are strange?
Best,
Dan
Dear All,
Quick query about question 2: is there an easy way to convince the glm
function to do first differences, or should we be writing a function from
scratch? Although the "xlevels" argument of "glm" looks like a promising
possibility, I have yet to figure out how to use it properly, and R help is
less than helpful...
Many thanks!
Best,
Dan
This is a multi-part message in MIME format.
------=_NextPart_000_0074_01C2ECDC.FBF91300
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
For Q2 on the homework:
To calculate fitted values, can we just substitute values for each x and =
calculate the predicted MIL using the estimated betas or do we have to =
do some sort of simulation?
------=_NextPart_000_0074_01C2ECDC.FBF91300
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>For Q2 on the homework:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>To calculate fitted values, can we just =
substitute=20
values for each x and calculate the predicted MIL using the estimated =
betas or=20
do we have to do some sort of simulation?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV></BODY></HTML>
------=_NextPart_000_0074_01C2ECDC.FBF91300--
Hi everyone,
A few things about the replication assignment:
1. First and most important, please turn in your assignment on time. Since
the next assignment is going to be the replication of someone else's
replication results, your late homework would cause a trouble for another
student in the class.
2. You can use any statistical package you want. If it's easier, you can
use SPSS, STATA, or whatever. The only reason we recommend that you use R
is that it's a nice software that allows you to do more than SPSS or
STATA. But, this assignment as well as all the other assignments will be
evaluated solely based on its quality not on what program you used.
3. In your Hw#5, indicate the title of your replication article and your
coauthor.
4. On March 31, "each" of you should turn in the following:
(a) a floppy disk containing the data, the program, and the description of
your replication procedure and results.
(b) two hard copies of the description of your replication procedure and
results.
(c) a hard copy of the replication article.
Good luck!
Kosuke