?replicate
?apply
?sapply
Nikhil Kaza
Asst. Professor,
City and Regional Planning
University of North Carolina
nikhil.list at gmail.com
On Aug 1, 2010, at 2:42 AM, leepama wrote:
>
> hi!! imade many codes during these days..
> I study Statistics....
>
> please one more question!!
> ex1<-function(n,p,rho){
> muvec1=zeros(1,p)
> A=eye(p)
> for(i in 1:p){
> for(j in 1:p){
> A[i,j]=rho^(abs(i-j))
> X=mvrnorm(n,muvec1,A)}}
> return(X)
> }
> this code generates design matrix in linare regression model..
> but this code only one data set..
>
> Is there any method to generate several data sets(design Matrix)??
> (in R
> program)
>
> please give me help..
> --
> View this message in context:
http://r.789695.n4.nabble.com/question-tp2309277p2309277.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.