找回密码
 注册
查看: 520|回复: 0

R语言 mcaGUI包 pmgRepeatTrials()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-26 00:34:44 | 显示全部楼层 |阅读模式
pmgRepeatTrials(mcaGUI)
pmgRepeatTrials()所属R语言包:mcaGUI

                                         A function to simplify simulations
                                         简化模拟函数

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

A simple function to repeat an expression several times as an aid to simplifying simulations.
一个简单的功能,重复几次表达为简化模拟的援助。


用法----------Usage----------


pmgRepeatTrials(expr, n = 10)



参数----------Arguments----------

参数:expr
An R expression, such as rnorm(1) or {x <- rnorm(10); t.test(x)\$p.value} that will be repeated n times.
一个R的表达,如rnorm(1)或{x <- rnorm(10); t.test(x)\$p.value}将重复n倍。


参数:n
Number of times to repeat the expressions. The default is 10.
多次重复的表达式。默认为10。


Details

详情----------Details----------

This functions aids in doing simulations. Rather than explicitly write a for loop or use sapply this function will call sapply on the expression.
此功能有助于在做模拟。明确,而不是写一个for循环或使用sapply这个函数将调用sapply表达。

A GUI for this appears in pmg under the Simluation tab. The "quick action" will call the function on the results of the simulation.
针对此界面显示PMG在下Simluation标签。 “快速行动”将调用模拟结果的功能。


值----------Value----------

The output of a sapply call can be a vector, matrix, ... If it is a vector, it is transposed/
sapply呼叫的输出可以是一个向量,矩阵,...如果它是一个矢量,它是转/


注意----------Note----------

This function and GUI was suggested by Daniel Kaplan at useR!2007
此功能和GUI建议由丹尼尔·卡普兰2007年的用户!


作者(S)----------Author(s)----------


John Verzani



举例----------Examples----------


  res <- pmgRepeatTrials(rnorm(1))
  hist(res)

  g = data.frame(
   father = c(78.5, 78.5, 77.5, 76.0, 75.5),
   mother = c(67.0, 68.0, 66.0, 65.5, 62.0),
   sex    = c("M", "M",  "F",  "F",  "M"),
   nkids  = c(4,     4,    1,    2,    5)
  )
  res <- pmgRepeatTrials(coef(lm(father~ sex + sample(nkids),data=g)),100)
  print(res)

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

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

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-2-3 21:46 , Processed in 0.033637 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表