So, now we know how to superimpose lines onto a plot...how about a
distribution? Specifically if we want to superimpose a normal
distribution onto the change.approval histogram, with the same mean and
standard deviation as the histogram?
I tried doing something like this:
> lines(ppoints(100)*40, 2850*dnorm(ppoints(100)*40
,mean(change.approval), sd(change.approval)), lty="solid")
and got a lovely normal distribution but only on the positive side of
the mean. Does anyone know how to make the other side turn up as well?
Zoe
NB The extra numbers are scale factors - 40 because I wanted the normal
to go from -20 to 20, and then 2850 because that's the number of
observations * width of the histogram bars = 570*5 = 2850.
Dear All,
many of you are struggling with the R programming language. You may not
have had time to look through all the materials. You may simply be
unfamiliar with programming terminology. You may understand the commands
involved but not have any idea how to structure your own series of them in
order to create a model. Do you feel behind? Overworked? Stressed out
about not understanding the homework?
If you fall into any of the above categories I would like to Help You.
I am going to be offering a "Crash Course in R Programming" on Monday or
Tuesday morning(s) (or both) depending on demand. The course will be free
to all Gov 1000 students and I promise it will make your life much easier.
Topics covered will include:
1) What a programming language is
2) What functions are and how to interpret them
3) What arguments are
4) What variables are
5) Manipulating variables in R
6) Conditional Statements and Loops in R
7) Basic Structured Programming Techniques
8) How to Write Your Own Functions
9) How to make Batch Files in R
10) How to plan and test a model in R (using an Easy to understand
solution to HW #2)
11) How to understand other people's programs and get use R's help
resources.
I expect that the course will be an hour and a half long, and will last
from 9-10:30, or from 10-11:30 on Mon or Tues.
*IMPORTANT*
If you ARE INTERESTED, you need to SIGN-UP so I can pick a time that works
for everyone. Please send me (tgood@fas) an email headed with a pound (#)
sign and containing the following Information:
1. Time Preference, 9-10:30, or 10-11:30
2. If you absolutely cannot make Mon. or Tues., list times on Mon. and
Tues. that would work.
3. Any topics in addition to above that you would especially like to see
covered (programming only please, Jas and Jacob are the experts in Stats)
Thanks for your time and hope you sign up. I guarantee your investment in
coming will pay off by the next problem set.
All the best,
T. Godwin Good
Class of 2004
I will be discussing the following two R files today:
1) Making Presidential Approval Figures: ApprovalFigure1.R
This file helps with the homework
2) Binomial Distribution Examples: BinomialExample1.R
This file gives R examples for the binomial distribution.
Both files are available on my webpage. The direct link to the
relevant page is: http://jsekhon.fas.harvard.edu/gov1000/R.html
After going through these two R files and reviewing some material from
last week, I will continue through the lecture notes starting on page
77 (Cumulative Distribution Function). The goal is to get to page 89
(covering the eight rules of summation). But I doubt I'll get that
far.
Cheers,
JS.
I will not be holding regular office hours this Wednesday. If you
wish to meet this week, please send me email to schedule an
alternative time.
Cheers,
JS.
MOUNTAIN INTERNATIONAL EMAIL LOTTERY.
FROM: MOUNTAIN INTERNATIONAL PROMOTION/PRIZE AWARD DEPT.
REF: OIEL/2311786008/01
BATCH: 14/011/IPD
RE: WINNING NOTIFICATION/FINAL NOTICE.
We are pleased to inform you of the result of the Mountain Lottery International programs held on the 7th of October 2003. Your e-mail address attached to ticket number 20511465886-629 with serial number 3772-99 drew lucky numbers 7-14-17-23-31-44, which consequently won in the 2nd category, you have therefore been approved for a lump sum pay out of Eight Hundred Thousand Euros (800,000).
CONGRATULATIONS!!!
Due to mix up of some numbers and names, we ask that you keep your winning information confidential until your claims has been processed and your money remitted to you. This is part of our security protocol to avoid double claiming and unwarranted abuse of this program by some participants.
All participants were selected through a computer ballot system drawn from over 100,000 ,000 company and 50,000,000 individual email addresses and names from all over the world. This promotional program takes place every three-year. We hope with part of your winning you will take part in our end of year 50 million Euro International lottery. To file for your claim, please contact our Fiduciary Agent MR. ADAM JANSEN of NORTH ATLANTIC VENTURES.
TEL: 0031-630-852-889.
Remember, all winning must be claimed not later than 21st of October 2003. After this date all unclaimed funds will be included in the next stake. Please note in order to avoid unnecessary delays and complications please remember to quote your reference number and batch numbers in all correspondence. Furthermore, should there be any change of address do inform our agent as soon as possible.
Congratulations once more from our members of staff and thank you for being part of our promotional program.
Note: Anybody under the age of 18 is automatically disqualified.
Sincerely yours,
Burri Diederik.
(Winning Co-ordinator)
I don't know why the attached message was sent out again. It is a
copy of a message I sent out Monday Sept 29. Something isn't right
with the gov1000-list mail server.
In any case, I do have two notices:
1) Recall that on the sign-up sheet which was sent around, the second
day of meetings is Wed Oct 15 (i.e., not this wed).
2) The midterm will be given during the first week of November.
Cheers,
JS.
>From: Jasjeet Singh Sekhon <jasjeet_sekhon(a)harvard.edu>
>Sender: gov1000-list-admin(a)fas.harvard.edu
>To: gov1000-list(a)fas.harvard.edu
>Subject: [gov1000-list] Updated Lecture Notes
>Date: Mon, 29 Sep 2003 02:49:02 -0400
>
>
>The online lecture notes have been updated. Please download the new
>versions. Today's lecture will begin on page 50 "Independence and
>Experimental and Nonexperimantal Research". I hope to cover the
>Bernoulli, binomial and normal distribution and get to page 80.
>
>Cheers,
>JS.
>
>======================================
>Jasjeet S. Sekhon
>Assistant Professor
>Harvard University
>Center for Basic Research in the
> Social Sciences
>jsekhon(a)fas.harvard.edu
>http://jsekhon.fas.harvard.edu/
>Office: 617.496.2426 Fax: 617.496.5149
>======================================
>
This is just a reminder that because of Yom Kippur, this week's
lecture has been moved from Monday to Wednesday at 6pm. This will be
a regular lecture not a section meeting so everyone should attend at
6. Because this class is substituting for section, I will spend part
of class lecturing on material which is relevant to the homework which
is due on Friday.
Cheers,
JS.
======================================
Jasjeet S. Sekhon
Assistant Professor
Harvard University
Center for Basic Research in the
Social Sciences
jsekhon(a)fas.harvard.edu
http://jsekhon.fas.harvard.edu/
Office: 617.496.2426 Fax: 617.496.5149
======================================
Hello everyone!
In case someone needs an edition of Wonnacott and Wonnacot, I have one for
sale
since I managed to double-order the book from Amazon... The choice is the
following: a brand new Wonnacott for $100 or a used version (the right
edition)
for $65. Alternatively I also have the third edition, second hand, for $1.
See, I LOVE statistics. Given my gift with ordering on-line though, I am
glad
there is no computer programming on the final.
Anyone interested?
Helene
Hello All,
Attach is an example of how to make plots in R (using the presidential
approval data). Also included are commands for the variance and
covariance. I will talk about this next Wednesday.
The command file is also available on the web at:
http://www.courses.fas.harvard.edu/~gov1000/Data/approval1.R
It can be run in R (on any computer connected to the internet) with
the command. With this command R will go get the command file:
>source("http://www.courses.fas.harvard.edu/~gov1000/Data/approval1.R")
I've attached the command file (approval1.R), the output
(approval1.Rout) and the produced figure (approval1.pdf)
Command file:
Output file:
Figure: