Hi, guys.
For this week's problem set, please identify and write out the stochastic
and systematic components (as the problem set requests).
Here's a summary of the questions that have gone to the list about this
week's problem set:
For both 1 and 2, you should only simulate parameters once. You should
re-use those draws to calculate the different quantities of interest.
For 1c, change the interaction term when you change the relevant variable.
For 2a1, the systematic component is the standardized normal CDF with mean 0
(not mu) and sd = 1.
For 2, use PRESINC as the incumbency variable. Do *not* include INC in the
regression.
For 2c, remember to change the interaction term along with everything else.
For 2c3, this is the plot Gary went over in class today.
Again, you aren't allowed to use either Zelig or Clarify for this
assignment.
Yours,
Olivia
I discovered an unpleasant R feature and wondered if anyone could
suggest a workaround or show me where I am going wrong.
I have been using logical statements and nrow() to extract the number
of observations that have certain characteristics.
for example, I thought the following statement
nrow(X[X[,1]==TRUE,])
would tell me how many rows of X had TRUE in the first column.
But it turns out that R considers anything that is TRUE or 1 _or_ NA
as TRUE. (The same is true when you say nrow(X[X[,1]==1,]).)
Can anyone tell me how to deal with this? Can anyone explain why R
would count NA as TRUE?
Andy
Hi,
I just sent out emails to each group telling each of you how many copies
to turn in. If you didn't recieve an email (e.g., I forgot your group),
please let me know ASAP.
And as an additional note, please turn in at least one copy of the article
as hardcopy (this is for me and gary). So you need:
In hardcopy:
1) Replication tables.
2) Original article (just one copy is fine).
3) Commented code file OR code file and comments
On disk or online:
1) The data
2) Any supplementary materials (e.g., a pdf of the article, etc.)
Thanks,
Olivia.
I am unsure what you mean exactly, but if you want to know the effect of a
0/1 switch, holding constant the other variables, then you probably want a
first difference.
Gary
------------------------------------------
Chunling wrote:
Hi Gary and Olivia,
What is the difference between " the average expected treatment effect for
coditional probability model" and "the average predicted treatment effect for
conditional prediction model"? If I have an dummy variable, say "having
insurance", as an independent variable, and i would like to know how switch
from 0 to 1 would affect the dependent variable "seeking medical care (0/1)",
should I use "first difference" command or "average expected treatmentn effect"
command ad "average predicted treatment effect" commaND?
Thanks very much.
Chunling
Quoting Olivia Lau <olau(a)fas.harvard.edu>:
> load() doesn't take arguments. Whatever was saved in "eggpow1.Rdata" is
> loaded under the name it was saved. Thus:
>
> save(eggpow, file="eggpow1.Rdata")
> load("eggpow1.Rdata")
>
> just loads eggpow back into the workspace. If you want to save it as
> something else and then load it back:
>
> eggpow1 <- eggpow
> save(eggpow1, file = "eggpow1.Rdata")
> load("eggpow1.Rdata")
> identical(eggpow1, eggpow)
>
> Olivia.
>
> ----- Original Message -----
> From: "Andrew Eggers" <aeggers(a)gmail.com>
> To: <gov2001-l(a)lists.fas.harvard.edu>
> Sent: Friday, November 19, 2004 3:54 PM
> Subject: Re: [gov2001-l] r question
>
>
> > Ben,
> >
> > Thanks. I had mistyped my code. I actually _had_ done
> >
> > save(eggpow, file="eggpow1.Rdata")
> >
> > in the original. So this is not the problem.
> >
> > Andy
> >
> >
> > On Fri, 19 Nov 2004 15:34:45 -0500 (EST), Benjamin King Goodrich
> > <goodrich(a)fas.harvard.edu> wrote:
> >> I am not quite sure, but I think the problem is in the save line.
> >>
> >> If you look at args(save), you will see that it the arguments go like
> >> this: ..., list=, file=). I think R is interpreting you as saying that
> >> you
> >> want your data and a string saved, or is interpreting the "eggpow1.Rdata"
> >> as the name of a list.
> >>
> >> Try save(eggpow, file="eggpow1.Rdata") and see if that does the trick.
> >>
> >> Ben
> >>
> >>
> >>
> >> On Fri, 19 Nov 2004, Andrew Eggers wrote:
> >>
> >> > i'm having trouble saving and loading data frames.
> >> >
> >> > at the end of the data cleaning and coding process, I am trying to
> >> > save the objects I want to keep in one data frame and then continue
> >> > working using just that data frame. here's what i do:
> >> >
> >> > eggpow<-as.data.frame(cbind( var1, var2, etc.))
> >> > save(eggpow, "eggpow1.RData")
> >> >
> >> > later, when I try to load and use it, I do:
> >> >
> >> > eggpow2 <- load("eggpow1.RData")
> >> >
> >> > but eggpow2 has
> >> >
> >> > > dim(eggpow2)
> >> > NULL
> >> >
> >> > >eggpow2
> >> > [1] "eggpow"
> >> >
> >> > I expected eggpow2 here to be identical to eggpow at the top. what am
> >> > I doing wrong?
> >> >
> >> > Andy
> >> > _______________________________________________
> >> > 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
>
Hi, everyone.
Paul has a good point. On Monday you should turn in the
following:
1) A hardcopy of the replicated tables (with enough text to
explain the tables), with any extensions that you have
completed.
2) A commented code file with enough information so that anyone
can not just re-run, but reconstruct your thinking. You may
choose to turn in a code file with the comments in a separate
document.
3) You also need to provide your data (either on a CD or on a
website).
I'll let you know how many copies of the above to turn in
tomorrow afternoon. In addition, you may also wish to provide a
pdf or hardcopy of the original article, and any supplementary
information that you think someone will need to do next week's
assignment. The goal is to make this as easy as possible for
someone to *reconstruct* your replication, not just source or
load your code file.
Also, some have asked whether they can use Stata rather than R
for this assignment. The programming language for this course
is R because we want you to be able to simulate quantities of
interest from the model, not just stop with the coefficients.
If you know Stata well enough to do this on your own, you should
feel free to use Stata. If you are unable to simulate in Stata,
however, you should use R because we teach simulation in this
course in R, and your final paper will require simulation to
interpret the regression output.
Yours,
Olivia
----- Original Message -----
From: "Paul Bodnar" <bodnar(a)fas.harvard.edu>
To: <olau(a)fas.harvard.edu>
Sent: Saturday, November 20, 2004 1:51 PM
Subject: just a suggestion
> People seem to have very different interpretations of what
> they're
> supposed to hand in. Some groups are apparently just planning
> to turn in
> replication tables; others (like us) the entire replication
> code
> with a step-by-step guide on how to redo it again
> (as I thought Gary said to do).
>
> ALso, I think people are unclear about what the next
> assignment will
> involve. Will we just have to essentially proof people's
> replications by
> reading the original paper and running their code? Or is it
> more than
> that? Given that it's Thanksgiving weekend I think it would
> be good to
> clarify this so we can get an estimate of how much work this
> will take.
>
> Thanks,
> Paul
>
i'm having trouble saving and loading data frames.
at the end of the data cleaning and coding process, I am trying to
save the objects I want to keep in one data frame and then continue
working using just that data frame. here's what i do:
eggpow<-as.data.frame(cbind( var1, var2, etc.))
save(eggpow, "eggpow1.RData")
later, when I try to load and use it, I do:
eggpow2 <- load("eggpow1.RData")
but eggpow2 has
> dim(eggpow2)
NULL
>eggpow2
[1] "eggpow"
I expected eggpow2 here to be identical to eggpow at the top. what am
I doing wrong?
Andy
Hi, guys.
FAS has just upgraded R to 2.0.0 on the servers. Those of you who are
using non-standard packages should run update.packages() to get the clean
version.
If you have problems come to OH tonight.
Yours,
Olivia.
Hi, everyone.
I've discussed this with Gary and we've decided to give you an extension
on the problem set due this Thursday until the Thursday after
Thanksgiving (Dec 2). This is intended to give you more time to work on
the replication due this coming Monday (Nov 22) and the memo (replication
of someone else's replication) due the following Monday (Nov 29). Those
who have already done the problem set will be able to simulate quantities
for non-standard distributions in time for the 22nd, so that's a bonus for
those groups (because everyone will have to simulate quantites for their
final paper and you can have someone else check your work if you turn it
in now).
We will not accept any late replications because everyone has to replicate
someone else's replication in the following week, so having missing
replications would throw everything off. In light of this, if you fail to
turn in your replication, you won't recieve a memo assignment (a
replication to replication) and will recieve a 0 for both the replication
assignment and the memo. I hope this encourages everyone to turn in the
replication on time -- even if it's not complete (e.g., you couldn't
replicate tables 5-10 out of 10), you should still turn it in to get
feedback (and some points).
In addition, sections are cancelled this week. I'll hold additional OH
upstairs in the CBRSS bay. Please come if you are having problems, need
something explained, etc. (Those of you who have made additional
appointments can keep those.)
Finally, I need *one* individual from each group (please coordinate among
yourselves) to send me the following info ASAP:
1) Group members (only count people who are taking the course for credit)
2) Title of the paper
3) Your estimated level of difficulty getting your stuff to replicate:
Let 1 be really easy and 10 be impossible
(This will affect the number of copies you have to turn in on Monday.
I've realized that there are a lot of groups of 3, so turning in 3 copies
will be insufficient.)
Thanks!
Olivia.