lmm.simudata: An R function to generate a simulated data set

Description Usage Arguments Value Author(s) References Examples

View source: R/mqfunctions.r

Description

An R function to generate a simulated data set with given parameters, model, and data structure.

Usage

1
lmm.simudata(formula, data = list(), v, b, SimuNum = NULL)

Arguments

formula

A linear mixed model formula

data

A data frame. It can be default.

v

A vector of preset variance components

b

A vector of present fixed effects.

SimuNum

The number of simulations. The default number is 200.

Value

Return a simulated data set which is a matrix.

Author(s)

Jixiang Wu <jixiang.wu@sdstate.edu>

References

Rao, C.R. 1971. Estimation of variance and covariance components-MINQUE theory. J Multiva Ana 1:19

Rao, C. R. and Kleffe, J. 1980. Estimation of variance components. In Handbook of Statistics. Vol. l: 1-40. Krishnaiah, P. R. ed. New York. North-Holland.

Searle, S. R., Casella, G. and McCulloch, C. E. 1992. Variance Components. John Wiley & Sons, Inc. New York.

Wu J (2012) GenMod: An R package for various agricultural data analyses. ASA, CSSA, and SSSA 2012 International Annual Meetings, Cincinnati, OH, p 127

Wu J., Bondalapati K., Glover K., Berzonsky W., Jenkins J.N., McCarty J.C. 2013. Genetic analysis without replications: model evaluation and application in spring wheat. Euphytica. 190:447-458

Zhu J. 1989. Estimation of Genetic Variance Components in the General Mixed Model. Ph.D. Dissertation, NC State University, Raleigh, U.S.A

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  library(minque)
  data(ncii)

  lmm.inf=lmm.check(Yld~1|Female*Male+Rep,data=ncii)

  lmm.inf  ##there are five variance components
  v=c(20,20,20,20,20) ##there are five variance components
  b=as.vector(100)    ##there is only population mean as fixed effect
  Y=lmm.simudata(Yld~1|Female*Male+Rep,data=ncii,v=v,b=b,SimuNum=50)



  #End

minque documentation built on Jan. 11, 2020, 9:18 a.m.

Related to lmm.simudata in minque...