Maybe this is a dumb question, but I assume 2.3 is asking to use monte carlo to estimate var(x), etc. with regard to the specific alpha and beta values mentioned in 2.2? Or are we somehow supposed to figure this out with regard to arbitrary alpha and beta?
Thanks,
Nick
I'm trying to multiply my matrix by the betas I was given for problem 3.3,
but I keep getting the following message:
Error in x.mats %*% betas : requires numeric matrix/vector arguments
Here's my code: I'm pretty sure I'm doing this right so I don't know whats
up.
betas <- matrix(c(4,2,-3,1), ncol = 1, nrow = 4, byrow=T)
data <- read.csv("covs.csv", header=TRUE)
head(data)
ones <- c(rep(1,1000)
x.mats <- cbind(ones, data)
head(x.mats)
x.mats%*%betas
Hey guys,
THis is a random, potentially stupid question, but for 2.3 what kind of
distribution should we be pulling samples from for the cosine function part?
Thanks,
Abby
Hey folks,
One of our distance students is looking for a someone to collaborate
on problem sets with. Are there other students -- maybe other distance
students -- out there who might like someone to work with (via email
and phone)?
If so, will you please let me know and I'll put you in touch?
thanks!
Maya
Hey, I hope we can create a homework thread for questions and answers.
For 2.3, do we take the a and b values from 2.2? I have never done these
types of calculations before so I was wondering how this is to be done.
Thanks!
Han
Hi all,
Hope everyone had a great weekend!
I just have a quick administrative announcement. By now all enrolled
students should have access to all portions of the FAS course website
(http://isites.harvard.edu/k66011), including the lecture videos and
the course dropboxes. We've set up the course dropbox for the first
problem set, but I would appreciate if you could double check that you
can see this dropbox sometime before Thursday, when the problem set is
due. (You will have to log into the course website or to my.harvard to
see any of the dropboxes.) If you cannot see the course dropbox, then
please email me and I'll see if I can fix it.
Also, please let me know if you are unable to see the lecture or section videos.
many thanks,
Maya
Ps. I've also posted in the "Problem Sets" portion of the website the
homework policy handout that we circulated in section on Thursday.
Please take a look at it before submitting your problem set!
hi all,
I've posted some optional R problems on the course website (under
"Problem Sets"). We'll post the answers to these problems Thursday
after section.
Also, some folks requested info on how to get started with LaTeX.
There's a lot of stuff out there on the internet, but I've found the
following useful:
http://www.andy-roberts.net/misc/latex/latextutorial1.html (a
beginner's guide, with links to more advanced tutorials)
http://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/ (a shorter guide)
http://www.tex.ac.uk/tex-archive/info/beginlatex/html/ (a longer guide)
http://web.ift.uib.no/Fysisk/Teori/KURS/WRK/TeX/symALL.html (many of
the latex math symbols you'll need; I refer to this at least once a
day!)
ftp://ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdf (a more
detailed guide on how to include math equations into your document)
With LaTeX, it's important to save and compile your document often;
that way you can track down problems with your code as you go along.
(There's nothing worse than a document that won't compile minutes
before it's due!)
hope this helps -- as always, please feel free to email the list with questions.
best, Maya
Hi folks,
Someone left their copy of Unifying Methodology in K-354 after lecture. I
placed it underneath the IQSS mail folders around the corner from the
classroom, so whoever lost it can go retrieve it.
best, Maya
Hi Eric,
That's usually what it's referred to in R. A more general term that I've
seen is also "design matrix." (Also -- people would know what you were
talking about if you called it the covariate matrix or something like that.)
For those of you unsure what we're talking about, here's some sample code
that extracts the model (design) matrix from an lm output. ("lm" is R's
simple linear regression function.)
> ## extracting the model matrix
> x <- c(1,2,3,4,5)
> y <- c(6,3,67,3,6)
>
> my.lm <- lm(y ~ x)
> ## regressing y on x
>
> model.matrix(my.lm)
(Intercept) x
1 1 1
2 1 2
3 1 3
4 1 4
5 1 5
attr(,"assign")
[1] 0 1
> ## extracting the model matrix
The output from the model.matrix function is, as Eric described, a matrix
with a row for the X variable (the numbers 1 through 5), as well as a column
of 1's, which represent the intercept.
hope that helps --
Maya
On Mon, Feb 1, 2010 at 11:27 AM, Lin, Eric <elin at hbs.edu> wrote:
>
>
> Trying to recall terminology from last term?s gov2000:
>
> If you have a series of explanatory variables, x1,x2, and x3, and you want
> to use matrix algebra to estimate OLS, you want to create a matrix with
the
> first column as just 1?s, followed by x1, x2, x3. What is this matrix
> formally called? Is this the ?model matrix??
>
> Thanks!
>
> EXL
> _______________________________________________
> gov2001-l mailing list
> gov2001-l at lists.fas.harvard.edu
> http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
>
>