Hello to anyone who is still reading this,
I am working with elections data in which I have the votes a candidate
received but not if they won or not. I want to add a couple columns
to my dataset just noting if the candidate won and by how much. I feel
like this should be easy. And yet…
Here is what I've done
length(unique(data$constituency))
mat<-as.vector(unique(data$constituency))
for(i in 1:229){
sub<-data[data$constituency==mat[i],]
ordered<-sub[order(sub[,"vote"], decreasing=TRUE),]
win<-ordered[1,]
second<-ordered[2,]
totalvotes<-sum(sub[,"vote"])
winvote<-win[,"vote"]
secvote<-second[,"vote"]
margin<-winvote-secvote
pcntmarg<-as.numeric(margin/totalvotes)
data[data[,"name"]==win[,"name"],]$marginwin[]<-pcntmarg
data[data[,"name"]==win[,"name"],]$elected[]<-1
}
Resulting in these errors:
Error in `$<-.data.frame`(`*tmp*`, "marginwin", value = numeric(0)) :
replacement has 0 rows, data has 1
Any words of wisdom?
Thanks from Ghana!!
Julie
_______________________________________________
gov2001-l mailing list
gov2001-l(a)lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
Hi Gang, here's an interesting project for anyone interested in health
policy. Please contact Lory directly if you're interested.
Gary
--
*Gary King* - Albert J. Weatherhead III University Professor - Director,
IQSS - Harvard University
GKing.Harvard.edu <http://gking.harvard.edu/> - King(a)Harvard.edu -
@kinggary<http://twitter.com/kinggary>- 617-500-7570 - Asst 495-9271 -
Fax 812-8581
---------- Forwarded message ----------
From: Lory Wallach <lwallach(a)firstopinion.com>
Date: Fri, May 20, 2011 at 12:27 PM
Subject: Re: First opinion-- consulting assistance.
To: Gary King <king(a)harvard.edu>
Hi Gary
The First Opinion is a medical knowledge-based system designed to give
medical advice to the general public and decision support to clinicians. The
System is web-based and can be accessed through any internet browser, smart
phone or dumb phone through interactive voice response and automatic
speech recognition
technologies in most languages. Using an Internet based authoring
approach; the First Opinion system encodes a highly useful core of expert
and general practitioner diagnostic and treatment knowledge into a computer
system that can be accessed by clinically trained individuals as well as by
any individual consumer. The System has two different front ends that
support both of these audiences. The System has the ability to consider
every disease of mankind (24,000) for anyone seeking consultation
For patients-- this provides free and easy access to diagnosis-- and answers
the questions-- what is wrong with me... what is my next best step for care,
was the diagnosis made by my provider correct.
For providers-- it acts as a clinical decision support system especially for
those that do not have access to that through an EMR.
We are seeking consulting help to size the global market. We know it is
huge-- and we want to put some measures around that. This could include what
is the gap in the global capacity to make a medical diagnosis, what is the
demand for receiving a correct and timely diagnosis, what is the cost of
incorrect or delayed diagnosis, what is the potential reduction in pain and
suffering, what is the impact on freeing up capacity so that health care
resources can be used more effectively?
Thank you for sharing this request for consultative services with your
capable students and colleagues.
Best,
Lory Wallach
858-733-2145
_______________________________________________
gov2001-l mailing list
gov2001-l(a)lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
Hi Class,
Sorry for the harassment far after the end of class. I'm using survey data with
weights and, if I use matching and readjust my quantity of interest to the
average treatment effect on the treated, should I still be using survey
weights? My inclination is that the answer is no, especially since I might be
using the weights from matching in the regression.
Any help is much appreciated!
Best,
Leslie
p.s. if any of you have ever used "svydesign" in R, I'm trying to figure out
what exactly i'm supposed to put for "id"...
_______________________________________________
gov2001-l mailing list
gov2001-l(a)lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
--
gov2001 mailing list served by Harvard-MIT Data Center
List Address: gov2001(a)lists.gking.harvard.edu
Subscribe/Unsubscribe: http://lists.gking.harvard.edu/?info=gov2001
Gov 2001,
I've been asked by the Extension School to remind all extension school
students that evaluations are due on Monday. Please fill them out they are
extremely important to us!
(I am pretty sure everyone else has an extra week, but be sure to do them!)
Brandon
_______________________________________________
gov2001-l mailing list
gov2001-l(a)lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
IQSS is sponsoring what looks like will be a great conference on political
economy and the law. in case you're interested, pls see the attached.
Gary
_______________________________________________
gov2001-l mailing list
gov2001-l(a)lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
Thanks everyone for sending in your memos and posting replication data to
Dataverse. Congratulations on being done with the class!
I have to actually release the individual studies before they appear
publicly on dataverse. I've released all those that were "submitted for
review." If your study is still in "Draft" state, please click "submit for
review" so that I know you are ready for it to be publicly posted. Thanks
guys!
Brandon
_______________________________________________
gov2001-l mailing list
gov2001-l(a)lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
Thanks to everyone who came out for the text section tonight. Because the
files are really large, I've put them in the public folder of my dropbox.
You can grab them here:
http://dl.dropbox.com/u/12848660/Bundle.zip
Eventually they will be up on my website but until I have time to take care
of that I will leave this link active. The zipped folder is approximately
75MB and contains the following:
1) Tonight's Section Slides
2) The code to grab word counts from the NYT API
3) An R package you will need to install locally to use the code above
(RJSONIO also available from OmegaHat)
4) Some R code to grab tweets off twitter and do some basic count work with
them.
5) A Folder of Materials from a Presentation I gave at University of
Washington including:
5a) A Lab Handout walking through three clustering algorithms: k-means,
Latent Dirichlet Allocation, Grimmer's Expressed Agenda Model
5b) The slides from my presentation on clustering algorithms
5c) A references list including software, textbooks and articles for text
analysis
5d) The files needed to do the lab
5e) The files I used to prep the labs from the raw text
5f) The raw texts
The workshop website is here: http://toolsfortext.wordpress.com/ and if you
really can't get enough of me talking I think there's a video on there
somewhere of me giving the presentation.
If you guys have any questions about the material- feel free to shoot me an
email. Good luck with the end of semester rush!
Brandon
_______________________________________________
gov2001-l mailing list
gov2001-l(a)lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
Anyone feel like doing some teaching? See below.
Gary
---------- Forwarded message ----------
From: Moffitt, Susan <susan_moffitt(a)brown.edu>
Date: Wed, May 4, 2011 at 12:14 AM
Subject: request from Brown for methods instructor recommendations
To: king(a)harvard.edu
Dear Gary,
I hope this finds you doing well.
The Political Science department at Brown is looking to hire someone to
teach 1 or 2 methods courses in the Spring of 2012 (1 undergraduate course,
1 graduate level course). I wondered, are there any advanced graduate
students in the Government Department or someone affiliated with IQSS who
you recommend we contact? Many thanks.
I hope our paths cross again soon.
My best,
Susan Moffitt
Susan L. Moffitt
Mary Tefft and John Hazen White Sr. Assistant Professor
Department of Political Science and Taubman Center for Public Policy
Brown University
36 Prospect St., Box 1844
Providence, RI 02912
Phone: 617.909.4957
Email: Susan_Moffitt(a)Brown.edu
_______________________________________________
gov2001-l mailing list
gov2001-l(a)lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
Just a reminder to everyone I will be doing a bonus section on text analysis
tonight at our normal time in our normal place (7PM-8:30PM, K354).
Unfortunately the section won't be videotaped- indeed the extension school
was kind enough to pay for the extra section last week, but two extra
sections is pushing it a little. So come out and listen in person!
Brandon
_______________________________________________
gov2001-l mailing list
gov2001-l(a)lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
Gov2001,
The designers of NB (the text annotation software) have been working on an
"alpha" version of their new interface. They're looking for a few students
to try it out and give them a little feedback about their experience with
it. If you're interested in trying it out, please email Sacha Zyto <
sacha(a)mit.edu>
It doesn't have all the features of the current interface: so far they have
tried to improve the PDF reading experience, which you may find useful.
These guys did us a huge favor by letting us use NB this term so hopefully
some folks can help them out.
Brandon
_______________________________________________
gov2001-l mailing list
gov2001-l(a)lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l