Dear Olivia,
Could you please add Eddie Malesky (also an academy fellow who is auditing
the class) to the class email list (emalesky(a)wcfia.harvard.edu).
Thank you!
Gretchen
----- Original Message Follows -----
> Hi, everyone.
>
> Kate had some good questions. For a program template, look at Zelig,
> Chapter 6, Section 2.1. For those of you who find this oenerous, the
> program looks like this:
>
> check <- function(p, q) {
> result <- (p-q)/q
> result
> }
> check(4, 5) # or check(p = 4, q = 5)
>
> Several things to note:
> * The curly braces {} enclose the commands that the program will
> perform.
> * The parentheses () are to define the arguments that go into the
> function (or for mathematical operations, as in line 2).
> * The <- stores symbols. So line 1 stores the function as check (we
> run the function by typing check and the arugments), but the second
> arrow in line 2 stores information only within the function itself (you
> can't find results once you exit the function), so you have to make
> sure that you return the function's output in the last line of the
> function (as in line 3).
> * When writing code, more spaces are better -- this makes your code
> readable.
> * Please comment your code so I know what's going on. If your
> function bombs but you comment your code, you will get partial credit.
> * If you want to check your OLS function, you can use zelig(....,
> model = "ls").
>
> On Kate's second question, you can use any text editor (Notepad, Wordpad
> , Microsoft Word), but this makes formatting your code more difficult.
> One of the neat things about XEmacs is that it highlights your braces
> and indents your code so you can see where you're going wrong.
>
> Also, I discovered that the set up on the course web site for Windows
> XEmacs lets you export your graphics to a file that you can put in a
> Word document, if you don't want to use latex. If you go through the
> process of setting up Windows XEmacs, you'll still learn to use R
> properly, but you'll be able to use Word (until you learn TeX).
>
> Keep the questions coming. 8)
>
> Yours, Olivia
>
> ----- Original Message -----
> From: "Kate Emans" <emans(a)fas.harvard.edu>
> To: <olau(a)fas.harvard.edu>
> Sent: Friday, September 24, 2004 3:32 PM
> Subject: request for simple program example
>
>
> > Hi Olivia!
> >
> > 1) I've been pondering R and trying to filter all the information. I
> > think (and I suspect others will agree) that it is not too hard to
> > figure out how to use individual commands. But it is difficult w/
> > out knowing R set-up, what is the basic syntax for a simple
> "program." >
> > I'm wondering if you could send us an example, sort of a template, for
> > a very simple R program that we could use as an example? Of course I
> > don't want you to give away how to do anything in the prob set, so it
> > could be a program that does something simple: like make two
> > matricies and multiply them. But I think it would really help just
> > to see the basic set up from start to finish of a simple program and
> > what exactly this looks like; what are the good basic commands to
> > start and end with and how do they string together. THis is hard to
> get from the manual. >
> > 2) Also, a specific question: can we use any text editor to create a
> > program of R commands? Obviously learning Emacs is desirable but if
> > we can't do it quite yet, will any text editor work, or just that
> one? >
> > THanks very much for your help. I send this to you and not hte whole
> > list so if you think question one is unreasonable you will not be
> > pressured to do it! But if you answer you can send to the whole list
> > along w/ my question.
> > :) Kate
> >
>
> _______________________________________________
> gov2001-l mailing list
> gov2001-l(a)lists.fas.harvard.edu
> http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
Hi, everyone.
Kate had some good questions. For a program template, look at Zelig,
Chapter 6, Section 2.1. For those of you who find this oenerous, the
program looks like this:
check <- function(p, q) {
result <- (p-q)/q
result
}
check(4, 5) # or check(p = 4, q = 5)
Several things to note:
* The curly braces {} enclose the commands that the program will perform.
* The parentheses () are to define the arguments that go into the function
(or for mathematical operations, as in line 2).
* The <- stores symbols. So line 1 stores the function as check (we run
the function by typing check and the arugments), but the second arrow in
line 2 stores information only within the function itself (you can't find
results once you exit the function), so you have to make sure that you
return the function's output in the last line of the function (as in line
3).
* When writing code, more spaces are better -- this makes your code
readable.
* Please comment your code so I know what's going on. If your function
bombs but you comment your code, you will get partial credit.
* If you want to check your OLS function, you can use zelig(...., model =
"ls").
On Kate's second question, you can use any text editor (Notepad, Wordpad,
Microsoft Word), but this makes formatting your code more difficult. One of
the neat things about XEmacs is that it highlights your braces and indents
your code so you can see where you're going wrong.
Also, I discovered that the set up on the course web site for Windows XEmacs
lets you export your graphics to a file that you can put in a Word document,
if you don't want to use latex. If you go through the process of setting up
Windows XEmacs, you'll still learn to use R properly, but you'll be able to
use Word (until you learn TeX).
Keep the questions coming. 8)
Yours, Olivia
----- Original Message -----
From: "Kate Emans" <emans(a)fas.harvard.edu>
To: <olau(a)fas.harvard.edu>
Sent: Friday, September 24, 2004 3:32 PM
Subject: request for simple program example
> Hi Olivia!
>
> 1) I've been pondering R and trying to filter all the information. I
> think (and I suspect others will agree) that it is not too hard to figure
> out how to use individual commands. But it is difficult w/ out knowing R
> set-up, what is the basic syntax for a simple "program."
>
> I'm wondering if you could send us an example, sort of a template, for a
> very simple R program that we could use as an example? Of course I don't
> want you to give away how to do anything in the prob set, so it could be a
> program that does something simple: like make two matricies and multiply
> them. But I think it would really help just to see the basic set up from
> start to finish of a simple program and what exactly this looks like; what
> are the good basic commands to start and end with and how do they string
> together. THis is hard to get from the manual.
>
> 2) Also, a specific question: can we use any text editor to create a
> program of R commands? Obviously learning Emacs is desirable but if we
> can't do it quite yet, will any text editor work, or just that one?
>
> THanks very much for your help. I send this to you and not hte whole list
> so if you think question one is unreasonable you will not be pressured to
> do it! But if you answer you can send to the whole list along w/ my
> question.
> :) Kate
>
Hi,
Please email (or catch me in section) if you are at all
interested in working on something interdisciplinary
(Buss/govt). I am most likely to obsess about issues
related to investment decisions under uncertainty (and
perhaps how various governments impact those decisions).
I can also potentially get hold of a few good data sets
from WIP at HBS.
Cheers,
Ayesha
one more R reference card, it is sort of like the others.
(and I'm not sure where it came from)
Also: topic wise---- if comparative institutions vis-a-vis uncertainty piques
your interest-- which is all I'll say for right now.... drop a line, I'll be
glad to expand.
cheers
Tassili
Hi,
The section notes, handouts, and problem set are up on the course web
site. There is a correction to the Linux handout: You should log in to
nice.fas.harvard.edu the first time, not nice.harvard.edu.
Yours,
Olivia.
Hi,
On the class website, under handouts, there are a couple choices
for setting up your computing environment (will discuss the
tradeoffs between Windows and Linux in section). You should
view these documents on-line -- there are links built into the
.pdf files that will take you directly to the appropriate
installers.
Thus, if you're trying to install R for Windows, look at the
handout and click on the blue box around the R and it should
take you to the installation page, which is:
http://www.cran.mirrors.pair.com/bin/windows/base/,
for your reference.
Best,
Olivia
Hi, everyone!
Just a reminder:
Section this week will be from 6-7pm in Room 22 at CBRSS (34 Kirkland St., across from William James Hall).
If you have a laptop, you may want to bring it to the first section, but this certainly isn't required. I'm going to go over the following:
* How to set up your computational environment (hence, the laptop)
* Basic R commands
* Matrix algebra
* Least squares regression
See you on Thursday!
Olivia
Please, please, please only send email to the list from the email address
(your *.harvard.edu address) that you gave on Monday. Hence, if you have
a gmail, yahoo, or hotmail account that you would like to use for this
class, you should subscribe that address separately at
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
If Gary and I keep on getting bounces like this, we will have to turn the
list into a public list (which will drastically increase the amount of
spam you get).
------------------------
Date: Wed, 22 Sep 2004 15:44:39 -0400
From: Andrew Eggers <aeggers(a)gmail.com>
Reply-To: aeggers(a)post.harvard.edu
To: gov2001-l(a)lists.fas.harvard.edu
Subject: Co-author
Hello all,
I would like to write about voting in corporate proxy elections
(shareholders and mutual funds voting in annual meetings). There is a
small literature on this and a brand new dataset from the SEC that
presents a promising extension of current research. Contact me if
you're interested in working together and we can discuss.
Andy Eggers
Gov Dept G1
Olivia.