at the beginning of section is fine, whichever section you
attend.
----- Original Message -----
From: <emans(a)fas.harvard.edu>
To: <olau(a)fas.harvard.edu>
Sent: Thursday, September 30, 2004 9:17 AM
Subject: timing of turning in prob sets
> Hi Olivia,
> If we are coming to the second section, can we just turn in
> prob set at the
> beginning of that one?
> (I fear otherwise everyone will show up at the first section.
> . .I know I will)
>
> Thanks,
> Kate
>
sorry if of course meant:
> B <- X[2:3] you are indexing out of bounds because you are trying
> to assign a number that is in the second row in the third column
> of matrix X
> -----Ursprungliche Nachricht-----
> Von: Jens Hainmueller [mailto:jens_hainmueller@ksg05.harvard.edu]
> Gesendet: Thursday, September 30, 2004 3:57 PM
> An:
> Betreff: AW: [gov2001-l] Fw: problem set
>
>
> it means that you are trying to index a position in a matrix that
> does not exists.
>
> for example in a 2 row 2 colum matrix (X), when you try to index
> and there is no such number because the matrix is
> only 2 by 2. B <- X[2:2] would work for example, B becomes the
> second number in the second row of X.
>
> hope this helps!
>
> best,
> jens
>
>
> > -----Ursprungliche Nachricht-----
> > Von: gov2001-l-bounces(a)lists.fas.harvard.edu
> > [mailto:gov2001-l-bounces@lists.fas.harvard.edu]
> > Gesendet: Thursday, September 30, 2004 3:53 PM
> > An: gov2001-l(a)lists.fas.harvard.edu
> > Betreff: Re: [gov2001-l] Fw: problem set
> >
> >
> >
> > Does anyone know what the "subscript out of bounds" error usually means?
> >
> > Ellie
> >
> >
> > On Thu, 30 Sep 2004, Paul Bodnar wrote:
> >
> > > That's R-speak for "mayday, mayday"
> > >
> > > On Thu, 30 Sep 2004, Olivia Lau wrote:
> > >
> > > > control c, control c.
> > > >
> > > > ----- Original Message -----
> > > > From: "Jonathan Harris" <jaharris(a)fas.harvard.edu>
> > > > To: <gov2001-l(a)lists.fas.harvard.edu>
> > > > Sent: Thursday, September 30, 2004 1:16 AM
> > > > Subject: Re: [gov2001-l] Fw: problem set
> > > >
> > > >
> > > > > What's the command in R to kill a command/force quit a
> > > > > calculation?
> > > > >
> > > > > On Sep 30, 2004, at 1:14 AM, Olivia Lau wrote:
> > > > >
> > > > >> I don't think that quote is in context.
> > > > >>
> > > > >> ----- Original Message ----- From: "Kentaro Fukumoto"
> > > > >> <fukumoto(a)dg8.so-net.ne.jp>
> > > > >> To: <gov2001-l(a)lists.fas.harvard.edu>
> > > > >> Sent: Thursday, September 30, 2004 1:11 AM
> > > > >> Subject: Re: [gov2001-l] Fw: problem set
> > > > >>
> > > > >>
> > > > >>> Good evening, Wei and all,
> > > > >>>
> > > > >>>> In part d), do we need to answere under the condition of n
> > > > >>>> increase or just
> > > > >>>> assume n equal 50?
> > > > >>>
> > > > >>> I heard from her that we get less than 50 observations.
> > > > >>> Hope it helps.
> > > > >>>
> > > > >>> Kentaro
> > > > >>>
> > > > >>> _______________________________________________
> > > > >>> gov2001-l mailing list
> > > > >>> gov2001-l(a)lists.fas.harvard.edu
> > > > >>> http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
> > > > >>
> > > > >> _______________________________________________
> > > > >> gov2001-l mailing list
> > > > >> gov2001-l(a)lists.fas.harvard.edu
> > > > >> http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
> > > > >
> > > > > _______________________________________________
> > > > > gov2001-l mailing list
> > > > > gov2001-l(a)lists.fas.harvard.edu
> > > > > http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
> > > > >
> > > >
> > > > _______________________________________________
> > > > gov2001-l mailing list
> > > > gov2001-l(a)lists.fas.harvard.edu
> > > > http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
> > > >
> > > _______________________________________________
> > > gov2001-l mailing list
> > > gov2001-l(a)lists.fas.harvard.edu
> > > http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
> > >
> > _______________________________________________
> > gov2001-l mailing list
> > gov2001-l(a)lists.fas.harvard.edu
> > http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
> >
Thanks for asking, Alex.
I just need your code, no output, except when I ask for the
output. So in parts (b), (c), and (d), you should provide the
summary statistics requested in the question in a neatly
formatted table in the text.
----- Original Message -----
From: "Alex Liebman" <liebman(a)fas.harvard.edu>
To: <olau(a)fas.harvard.edu>
Sent: Wednesday, September 29, 2004 11:23 PM
Subject: problem set
> hey olivia,
>
> for the problem set, do you want to see all the r code and
> output, or can we just answer the questions? obviously, part a
> wants an r function, but what about for b, c, and d?
>
> thanks,
> alex
>
I'm having problems with my code: R doesn't recognize the objects I
define in my function, though it does recognize (and as far as I can
tell, correctly execute) the function. But, I need the
internally-defined objects in order to do other calculations. Any
thoughts on why R won't let me see those objects (matrices,
specifically)?
Hi,
I will not accept problem sets via email except under
exceptional circumstances (family emergency, accident, premature
death -- you can email me from the afterlife).
Please turn in your homework in section as hardcopy (printed
out). I do not require a separate R code file -- believe it or
not -- I can read your code (embedded in your problem set) and
tell whether it will work. Thus, as you answer part b in words,
you can put the code you used to get part b immediately below
the words.
See you Thursday at 5:30pm (or 6:30pm), and bring your laptops,
if you have them. We will be doing an intensive R tutorial
session.
Yours,
Olivia
You can't use the summary of the data to get your confidence intervals. You
have to use all the simulations of \hat{\beta} and \hat{\sigma^2} and put
them in order and take the appropriate percentiles of the simulations.
----- Original Message -----
From: "Alex Liebman" <liebman(a)fas.harvard.edu>
To: <olau(a)fas.harvard.edu>
Sent: Wednesday, September 29, 2004 4:34 PM
Subject: problem #c
> hey olivia,
>
> on problem c, are we meant to calculate the confidence intervals for the
> aggregate (ie, the means) of all the procedures we ran?
>
> in other words, to test the biasedness in part b, i took the mean of the
> constants, the mean of all the slopes, and the mean of all the variances.
> can we use this aggegate data to check confidence intervals? that just
> seems strange to me, because of course in the real world we'd only "run"
> the data once. i know this is a simulation problem, but there still seems
> to be something strange about this, even granted that we're trying to
> mimic the DGP. do you see what i mean?
>
> alex
>
Hi,
If you came to office hours yesterday and left a pair of glasses or a
handout marked up in purple ink, they are with the CBRSS receptionist.
Please retrieve them.
Yours,
Olivia
Andy,
Gary discussed this in class on Monday. Look at the code dealing with the
Monte Hall problem, specifically the line that says:
doorsLeft <- doors[doors != choice]
Part of the assignment is figuring out how R works (which is why the
assignment is pretty easy mathematically), so...you should look at Zelig
chapters 2-3, or more specifically p. 24. If you want to drop stuff, you
use the same commands, but on the LHS of the arrow. On the RHS of the arrow
is the new variable name. (As it is above.)
Yours,
Olivia
----- Original Message -----
From: "Andrew Eggers" <aeggers(a)gmail.com>
To: "Olivia Lau" <olau(a)fas.harvard.edu>
Sent: Tuesday, September 28, 2004 5:45 PM
Subject: R question
> O,
>
> I am tired of sifting through R manuals for this -- can you give me a
> few command hints?
>
> 1. how can I drop members of an object, given a logical condition (e.g.
> Y<2)?
> 2. how can I make operators work on an object containing missing
> values, and not themselves produce missing values?
>
> Thanks,
>
> Andy
>
Hi, Sara.
Next, think about what your code is doing. You store b every time you run
the loop. This means that only the last value of b is returned. (It's
great that you got this far already, btw.) So how can you make R store
every value of b rather than just the last value?
Think about how i works in this context. You actually have a value i
which you observe inside the loop which keeps track of which iteration
you're on. You need to use i to tell R where to store the b's for the ith
run. Look at Zelig, p. 51 for a hint.
So think about this some more and send me another email if you get stuck.
Olivia.
On Tue, 28 Sep 2004, Sara Bleich wrote:
> Olivia,
>
> I am stuck on part b of the homework and I was hoping you could help. I am
> using the following code:
>
> sims <- 10
>
> for (i in 1:sims){
> b<-here I put the beta equation
> }
>
> After running this loop, I and looking at "b" I am only getting two values,
> one for x1 and one for x2. Is that right or should I be getting 10 values
> for x1 and 10 values for x2 since I set sims to 10? Since part c is asking
> for confidence intervals it seems as if I would need to know all the means
> in order to answer the question correctly. Thanks for your help.
>
> Sara
>
> Ph.D. Candidate in Health Policy
> Harvard University
> bleich(a)fas.harvard.edu
> M: 617.899.5016
> W: 617.495.5602
>