1) The midterm is scheduled for Monday November 10th.
2) I will start lecturing today starting from page 72 ("Normal
Distribution"). We have covered some of this material already so I
will be moving fast through the normal distribution section. I plan
to complete the "Mean and Median" and "Rules of Summation; Variance
and Covariance" sections. And I hope to make it most of the way
through the "Mathematical Expectation" "Variance" and "Properties of
the Expectations Operator" sections.
3) I have posted a R file which provides hints for homework question
number 3.
The direct link is: http://jsekhon.fas.harvard.edu/gov1000/normal1.R
My R resources webpage: http://jsekhon.fas.harvard.edu/gov1000/R.html
Cheers,
JS.
After last week's problem set, I thought you might appreciate the linked NYT
article, especially the chart labeled "timing is everything" (accessible on the
right side of the page).
http://www.nytimes.com/2003/10/19/weekinreview/19STEV.html?hp
The sample seems a tad small and the variance a tad high to make strong
conclusions, but I'm sure the NYT knows best...
Paul
--
Paul Bodnar
Department of Government
Harvard University
+1 617 230 4525
bodnar(a)fas.harvard.edu
Homework #3 has just been posted on the course website:
http://www.courses.fas.harvard.edu/~gov1000/assignments/. It is due
next Thursday. There are two short answer and four long answer
questions.
Exam Date: A couple of students have asked if the midterm could be
moved to Monday November 10 (from the 3rd) because of obligations in
other courses. This is fine with me. Please let me know by
Wednesday evening if the 10th is a problem for anyone.
Cheers,
JS.
I really wanted to take part in R course. (already signed-up!)
However, the e-mail containing the relevant information from Trvais came after 12:00 pm
(after the course was over!)
Was anybody able to take part in the course?
What's the class and homework schedule for this week? Is it no class on
Monday but section as usual on Wednesday? Also, is there an assignment
due this Friday -- the website still only has Homeworks 1 and 2.
Thanks,
Kai-Hua
Hello All,
The R Course discussed in the previous email will be held from 10-11:30
tom. (Monday). We will meet in the Science Center by the renovated
Greenhouse and then find an appropriate location with a chalkboard.
If for some reason the sci center is not open, etc., we will meet outside
the main science center doors.
Best,
Travis Good
I know that many of you are concerned about question 4 on the
homework. It is worth keeping in mind that this question is only
worth 10% of this week's homework grade.
For additional help on For loops see:
1) Krause, Andreas and Melvin Olson. 2002. The Basics of S-PLUS. 3rd
ed. New York: Springer-Verlag. ISBN: 0387954562.
2) And pages 41 to 43 of the manual "An introduction to R" included
with R, click Help and then click Manuals.
If you have some code with which you would like help please send it to
the list.
ALSO: If possible, please submit your homework electronically this
week: gov1000(a)fas.harvard.edu
Cheers,
JS.
we are getting syntax errors out the wazoo, in particular a parse error when we
try to run the basic code for this problem in the 5 door case. can anyone help
with this?
randomdraw <- runif(5000)
doorA <- as.integer(randomdraw < .2)
doorB <- as.integer((randomdraw >= .2) & (randomdraw <.4))
doorC <- as.integer((randomdraw >= .4) & (randomdraw <.6))
doorD <- as.integer((randomdraw >= .6) & (randomdraw <.8))
doorE <- as.integer(randomdraw >= .8)
keptindices <- integer()
indicator <- 1
for (i in 1:length(doorA)) {
if (((doorA[i]==i)& runif(1)>.33))|(doorA[i]==0))
{
keptindices[indicator] <- 1
indicator <- indicator +1
}
}
door2 <- integer()
door3 <- integer()
for (i in keptindices) {
if (sum(doorE[i]+doorB[i]+doorC[i]+doorD[i])==0)
{
door2 [indicator] <- 0
door3 [indicator] <- 0
}
if (sum(doorE[i]+doorB[i]+doorC[i]+doorD[i])==1)
{
temp <- runif(1)
door2 [indicator] <- temp < .5
door3 [indicator] <- temp >= .5
}
}
Sorry, another question from me...
So as far as I understand, in order to find the percentage of time that
it's better to switch, we have to take the mean of a variable. I have
gotten completely lost in the terminology and assignments and variable
names...is this DoorB[keptindices]? or door2[keptindices]? Or
something else? Is there more code needed before I can take the mean of
something??
Z