楼主: kizgel
1559 8

[问答] 碰到一全英文的题目,不是很理解,能进来帮忙解答下题目或者答题思路吗 [推广有奖]

  • 0关注
  • 0粉丝

本科生

37%

还不是VIP/贵宾

-

威望
0
论坛币
2 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1059 点
帖子
68
精华
0
在线时间
60 小时
注册时间
2012-11-1
最后登录
2017-8-21

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

1.   [8] Make a binary infix operator called %ols% that takes thearguments x and y and returns the ordinary least squares regressioncoefficients for regressing y on x.  Inthis function x and y may any combination of vectors or matrices. Rather thanusing a built in R function, use the equation we saw in Question 2d) of thesecond assignment. This function should add a column of 1s to x so that anintercept is fit.  For examplex<-1:10; y<-2+3*x; y%ols%x returns: the vector 2, 3.


i)                  Regress ozone on temperature.  


ii)                Try replicating the model in Q1 f) by setting y to ozoneand x to a matrix where the first column contains radiation and the next twocolumns contain wind and temperature, respectively. Do this part in oneexpression.


2d)题目如下:

Assume that thereis an approximate linear relationship between Illiteracy and Murder rates.Given the design matrix defined above, we can define a simple linear modelas y=Xb+e where y (Murder) is the dependent variable, X is thedesign matrix (or matrix of independent variables), b is the vector ofparameters and e is the error term. The least squares estimate of b is:  bhat=(XtX) -1Xt y.Write an expression to calculate bhat in R. Note that Xt is thetranspose of X.


ozonetemperature 来自于下表:

QQ截图20150420195103.jpg


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:全英文 coefficients combination coefficient regression 答题

沙发
kizgel 发表于 2015-4-20 19:54:42 |只看作者 |坛友微信交流群
期末最后的大作业,不胜感激啊

使用道具

藤椅
nuomin 发表于 2015-4-20 21:04:49 |只看作者 |坛友微信交流群
挺好玩的题目,自己编一个操作符。楼主肯定能做出来

使用道具

板凳
kizgel 发表于 2015-4-20 22:56:01 |只看作者 |坛友微信交流群
nuomin 发表于 2015-4-20 21:04
挺好玩的题目,自己编一个操作符。楼主肯定能做出来
嗯嗯,谢谢肯定,不过能指点下题目大意或者思路吗,英文能力是硬伤,理解了题目应该能解答的

使用道具

报纸
kizgel 发表于 2015-4-21 21:29:11 |只看作者 |坛友微信交流群
有前辈能指点一下吗

使用道具

地板
waterhorse 发表于 2015-4-21 22:32:12 |只看作者 |坛友微信交流群
It's about conducting a linear regression model using matrix operation. Group your data in a data frame or matrix where y (the 1st column) is the response variable and the rest of the columns are explanatory variables.
The R code
y = da[,1]
x = cbind(1, da[,2], da[,4], da[,3])
beta = solve(t(x)%*%x)%*%(t(x)%*%y) #the estimates of beta

使用道具

7
kizgel 发表于 2015-4-22 14:15:35 |只看作者 |坛友微信交流群
waterhorse 发表于 2015-4-21 22:32
It's about conducting a linear regression model using matrix operation. Group your data in a data fr ...
哥们,你这个貌似对2d)的求解,目前求助的是上面的那个题目,谢谢啊

使用道具

8
kizgel 发表于 2015-4-22 14:42:27 |只看作者 |坛友微信交流群
kizgel 发表于 2015-4-22 14:15
哥们,你这个貌似对2d)的求解,目前求助的是上面的那个题目,谢谢啊
不好意思,您没错,刚刚没仔细看,现在已经解答了,谢谢啊

使用道具

9
kizgel 发表于 2015-4-22 14:45:10 |只看作者 |坛友微信交流群
此题已经没问题了,谢谢各位

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-14 02:07