Hi Nino.
For problem 2.1 you don't have to find a percentage. Just state whether or
not each of the two counterfactuals are in the convex hull of the data. For
2.2 you do need to find a percentage, so your argument for cfact will be a
matrix of n counterfactuals (i.e. as many rows as the data) where each row
is identical to the dataset, except the value of mar is switched.
Iain
On Thu, Apr 15, 2010 at 11:51 AM, Han He <han.he at college.harvard.edu> wrote:
> Hey Nino,
>
> I am not sure if what I did is correct but this is my procedure:
>
> For the two people, I dropped the intercept and added the expected value
> for art. For the data, I only used the X covariates.
>
> Code:
> results.M = whatif(data = bioChemists, cfact = X2.M)
> summary(results.M)
> results.U = whatif(data = bioChemists, cfact = X2.U)
> summary(results.U)
>
> X2.U and X2.M is the X covariates for an unmarried person and a married
> person with all other values at the median.
>
> Hope this helps.
>
>
> Best,
> Han
> Harvard College Class of 2013
> 614-329-1324
>
>
> On Thu, Apr 15, 2010 at 11:20 AM, Malekovic, Nino <
> nino_malekovic at hks11.harvard.edu> wrote:
>
>> Hi all,
>>
>> Can someone help me with the advice on the problem 2.1 in our PS7?
>>
>> This is my function in R. I can't get percentage, but that probably means
>> that I got it wrong altogethe.
>>
>> >counterfactual.one <- cbind(median(mar), median(femm), median(kid5),
>> mean(doctor), median(ment), median(mar))
>> >counterfactual.two <- cbind(median(mar)-1, median(femm), median(kid5),
>> mean(doctor), median(ment), median(mar)-1)
>> >counterfactuals<-rbind(counterfactual.one, counterfactual.two )
>> >counterfactuals[1,4]
>>
>> >coefficients<-as.data.frame(cbind(optimizing$par[2], optimizing$par[3],
>> optimizing$par[4], optimizing$par[5], optimizing$par[6], optimizing$par[8]))
>>
>> >verdict <- whatif(data = coefficients, cfact = counterfactuals)
>>
>> >summary(verdict)
>> >verdict$in.hull
>> >verdict$sum.stat
>>
>> Any help is appreciated.
>>
>> Nino Malekovic
>> MPA Candidate, Class 2011
>> Harvard Kennedy School
>> ________________________________________
>> From: gov2001-l-bounces at
lists.fas.harvard.edu [
>> gov2001-l-bounces at
lists.fas.harvard.edu] On Behalf Of
>> gov2001-l-request at
lists.fas.harvard.edu [
>> gov2001-l-request at
lists.fas.harvard.edu]
>> Sent: Thursday, April 15, 2010 7:46 AM
>> To: gov2001-l at
lists.fas.harvard.edu
>> Subject: gov2001-l Digest, Vol 57, Issue 19
>>
>> Send gov2001-l mailing list submissions to
>> gov2001-l at
lists.fas.harvard.edu
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>>
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
>> or, via email, send a message with subject or body 'help' to
>> gov2001-l-request at
lists.fas.harvard.edu
>>
>> You can reach the person managing the list at
>> gov2001-l-owner at
lists.fas.harvard.edu
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of gov2001-l digest..."
>>
>>
>> Today's Topics:
>>
>> 1. Drop box (Akihiro Nishi)
>> 2. Standard Error for 1.5 (Han He)
>> 3. Re: Standard Error for 1.5 (Michael Barnett)
>> 4. Re: Standard Error for 1.5 (Han He)
>> 5. Re: Standard Error for 1.5 (Iain Osgood)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Wed, 14 Apr 2010 15:42:04 -0400
>> From: "Akihiro Nishi" <anishi at hsph.harvard.edu>
>> Subject: [gov2001] Drop box
>> To: <gov2001-l at lists.fas.harvard.edu>
>> Message-ID: <4BC5E24C0200004600041E39 at hsph.harvard.edu>
>> Content-Type: text/plain; charset="us-ascii"
>>
>> Hi, Maya and Iain,
>>
>> I cannot find the course drop-box for Problem Set 7. Thanks!
>>
>> Akihiro
>>
>> >>> Jason Ketola 04/13/10 11:22 PM >>>
>> Thanks, Joseph. Thank you for pointing that out!
>>
>> I was definitely making it much harder on myself.
>>
>> Jason
>>
>>
>>
>>
>>
>> Gavinlertvatana, Poj wrote:
>> > Jason,
>> >
>> > For the homework, you don't need to take derivatives. 1.2 just asks
for
>> a function that calculates the ll, with inputs of parameters, x, and y. Just
>> take the log of the (product of) likelihood function. Later, in 1.4, you use
>> optim, which calls the ll function as in previous hw's.
>> >
>> > Outside of the assignment, you're right though that in general, you
>> would take two partial derivs to find the analytic answer -- i.e., find the
>> maximum of the log likelihood function.
>> >
>> > Best regards,
>> > Joseph
>> >
>> > Joseph Poj Gavinlertvatana
>> > Doctoral student, Marketing
>> > Harvard Business School
>> > Wyss Hall, Soldiers Field, Boston, MA 02163
>> > Ph 617.230.5907
>> > Fx 617.496.4397
>> > Txt/Vm 617.910.0563
>> > Em pgavinlertvatana at
hbs.edu
>> >
>> > -----Original Message-----
>> > From: gov2001-l-bounces at
lists.fas.harvard.edu [mailto:
>> gov2001-l-bounces at
lists.fas.harvard.edu] On Behalf Of Jason Ketola
>> > Sent: Tuesday, April 13, 2010 11:03 PM
>> > To: Class List for Gov 2001/E-2001
>> > Subject: [gov2001] 1.2 question
>> >
>> > This is likely due to my uncertainty about 1.1, but does finding the LL
>> > in 1.2 require us to take two partial derivatives?
>> >
>> > Thanks,
>> > Jason
>> > _______________________________________________
>> > gov2001-l mailing list
>> > gov2001-l at
lists.fas.harvard.edu
>> >
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
>> >
>> > _______________________________________________
>> > gov2001-l mailing list
>> > gov2001-l at
lists.fas.harvard.edu
>> >
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
>> >
>> _______________________________________________
>> gov2001-l mailing list
>> gov2001-l at
lists.fas.harvard.edu
>>
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
>>