楼主: zhouyong89
1715 1

[问答] 求教一道R语言的题 [推广有奖]

  • 3关注
  • 1粉丝

已卖:3份资源

大专生

75%

还不是VIP/贵宾

-

威望
0
论坛币
3004 个
通用积分
1.0000
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1327 点
帖子
12
精华
0
在线时间
110 小时
注册时间
2011-10-6
最后登录
2025-5-19

楼主
zhouyong89 在职认证  发表于 2011-11-22 20:41:40 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币

LetX be a matrix of random normal values (mean =0; sd=1) having 10 columns andN=100 rows. Reset the values in the first row in the matrix to(1,1.5,1.4,3,1.9,4,4.9,2.6,3.2,2.4). Assume that the first 5 columns of datafor each row correspond to a group A, while the remaining 5 to another group B.

1.) For each row of the matrix X, compute:

a) the t-statistic comparing the groups A and B assuming equalvariance and the p-value


b) Compute theprobability to observe such a t-statistics only by chance, using a permutationanalysis. The following strategy will be used: the columns will be randomlypermuted nk=1000 times, and at each iteration the t-statistic will be computedagain and recorded in a vector. At the end, compute the p-value as the numberof times out of nk when the t-statistic with the permuted data was at least asor more extreme than the t-statistics obtained with the real (non-permuteddata).   

Present the result as a data.frame with 4 columns: ID= Row number,t= t-score, p_theoretical=p-value assuming the asymptotic distribution;p_permutations=p-value from permutations;

Sort the data.frame in descending order of p-values.

2.) Plot the distribution (see hist)of the resulting vector of t-scores obtained at step 1a) after excluding the first element (correspondingto the first row) and on the same graph show a vertical line for the t-value ofthe first row.


二维码

扫码加我 拉你入群

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

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

关键词:R语言 distribution Permutation Probability Theoretical

沙发
DM小菜鸟 发表于 2015-1-7 14:50:03
可以发到项目交易或者发起悬赏

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-2 18:43