I would like to be able to make use of ideas from the lecture on recipricol
causation, but I am having trouble seeing how to get started.
My overall goal is to come up with a model that can be applied to any county to
obtain an estimate of the dollars of insurance premium an insurance company
would collect if they had an agent in that county. There are 3,100 counties of
which about 300 already have agents.
Causality clearly runs both ways: agents cause premium, and premium causes
agents. We collect more premium in counties where there are agents because
although the agents are free to sell policies anywhere, they tend to sell them
close to home. Just as clearly, agents set up shop where they think they will
be able to make sales so the presence of premium causes there to be agents.
If I could cause there to be an agent in a county where there isn't one now, I
should see increased premium only to the extent that agents cause premium and
not to the extent that premium causes agents.
Does this seem like an example of the sort of problem Gary was addressing in
yesterday's lecture? If so, is my first step to think of some explanatory
variables for the presence of agents that do not also explain the presence of
premium? That may be difficulat since presumably, agents go where the premium
is. (If a certain mix of SIC codes, growth rate, and population density causes
high available premium, then it indirectly also causes there to be agents.)
-Michael
-------------------
Michael J. A. Berry
Harvard email account
(Permanent email: mjab(a)data-miners.com)
Hi all,
I'm seeking advice about code I've put together to test a counterfactual.
Specifically, I'm trying to ask: What if all observations for our treatment
variable, the infant mortality rate (infantlag), were set to the 25th
quantile? How factual is this counterfactual? I'm using the code from page 4
of the Section 9 handout as my guide. My code reads:
library(WhatIf)
fact <- na.omit(Civil.Data)
counterfact <- na.omit(Civil.Data)
## I also tried running these prior two lines without using na.omit
counterfact$infantlag <- quantile(Civil.Data$infantlag, .25, na.rm=T)
whif <- whatif(data=fact,cfact=counterfact)
The last line of code returns the error message:
"Error in whatif(data = fact, cfact = counterfact) :
observed covariate data not coercable to numeric matrix due to
character column(s)"
Interestingly, I get the same error message when I try to replicate Dan and
Ian's code from that handout using the coalition data. I'd appreciate any
thoughts on what's causing this error message.
Thanks,
Janet
Hi,
I'm confused about some of the things we are asked to do. Here some
stupid questions.
* in (a) do we need to get the ATE and ATT for mail, phone, door,
i.e.6 different ATs, and compare?
* the MatchIt manual says that to get the ATT one needs to fit a
model on the 'control' group of the matched dataset only. This is
not intuitive... I would have said to do so for the treated group
and then get the ATT with a counterfactual in which the treated
didn't get treated.
* How does one use the weights in the matched dataset?
Best,
Juan
I am using Zelig to run negative binomial regression. It is returning fitted
values that are non-integers, which should not be the case. Does anyone know
what the source of this problem might be? In case it's relevant, the
dependent variable and the covariates in the model we are running are all
event-count variables and 0/1 dummy variables. The intercept is suppressed
because there are dummy variables for every category.
Thanks,
Jacqueline
Hello,
When one chooses a random sample of observations from a dataset, is there a
way to find out which observation numbers were put into this random sample?
That is, if I choose 5 random observations from a dataset with 100
observations, is there a way to tell whether it was observations 1, 2, 3, 4,
5, or observations 21, 46, 52, 16, 2, etc?
Thanks,
Jacqueline
--
Jacqueline Chattopadhyay
Ph.D Student, Government & Social Policy
Harvard University
jchattop(a)fas.harvard.edu
jchattop(a)gmail.com
714.313.7022
Hello all,
I am having trouble figuring out why this method of removing duplicated
treatments doesn't work. I am happy to do something else, but I don't
understand what's wrong with the code here.
GG$mult<-GG$mail+GG$phone+GG$door
GG.sing<-GG[GG$mult<2] ##Create new table with multiple treatments removed
Error in "[.data.frame"(GG, GG$mult <= 2) :
undefined columns selected
Greetings,
In trying to produce standard errors from my optimization process,
I got a hessian matrix with nothing but zeros. I have tried multiple
things and can't seem to find the error in my coding. Anyone have any
possible solutions?
Regards,
Sheldon
When trying to plot the propensity score from the matching objects
[[ plot (match.out) ]] I get the message:
Error in if (x$call$method == "full") { : argument is of length zero
I just updated my R-version and all the packages (MacOS). I was doing
the same operation this afternoon on an older version of the package
and it seemed to work fine. Could this be a bug in the new MatchIt
package? Or am I entering s.th wrong?
Thanks
---
Thomas Soehl
MPA candidate 2007 / McCloy Scholar
John F. Kennedy School of Government
Harvard University
Hi all,
I'm trying to create output to check the balance in the dataset consisting
of those respondents who were assigned to receive a phone call, and those
respondents who were not assigned to receive any one of the three treatments
(problem 1b). I copied and pasted the syntax given in the Section 10 handout
under the "##What did balance look like originally?" heading, replacing the
dataset and variable names as needed. I keep getting the following message:
Error in parse(file, n, text, prompt) : syntax error in "tout<- t.test(
TR.pre$NA"
Does anyone know why this is happening? I'd much appreciate any advice.
Thanks,
Jacqueline