please, how can i generate ten different estimated parameter with multiple y, 
response from the following response.

> true.slope<-5
> true.err.var<-3.7
> n.iter<-100
> s.sample<-10
> estimates<-matrix(NA,nrow=n.iter,ncol=2) 
> 
> list<-list()
> s.sample<-10
> x<-10*runif(s.sample) 
> 
> for(i in 1:n.iter) {
+ y<-true.intercept+true.slope*x+rnorm(s.sample,mean=0, sd=true.err.var) 
+ list[[i]]<-lm(y~x)
+ }
> list[[i]]

Call:
lm(formula = y ~ x)

Coefficients:
(Intercept)            x  
     12.133        5.447  

> 
        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to