[R] Regression Tolerance Intervals - Dr. Young's Code

Uwe Ligges ligges at statistik.tu-dortmund.de
Sun Jun 9 17:54:27 CEST 2013



On 08.06.2013 05:17, Muhuri, Pradip (SAMHSA/CBHSQ) wrote:
> Hello,
>
> Below is a reproducible example to generate the output by using Dr. Young's R code on the above subject .   As commented below, the issue is that  part of the code (regtol.int and plottol) does not seem to work.
>
> I would appreciate receiving your advice toward resolving the issue.
>
> Thanks and regards,
>
> Pradip Muhuri
>
>
> setwd ("E:/")
> require ("tolerance")
>
> d1<- "xlndur      ylnant
> 8.910797  0.33901690
> 9.001415  0.36464311
> 8.983936  0.53976194
> 8.948035  0.33901690
> 9.056784  0.39266961
> 9.018593  0.18617770
> 9.001415  0.53976194
> 8.983936 -0.11005034
> 8.966147  0.53102826
> 8.948035  0.59885086
> 6.900000  NA"
>
> xd1 <- read.table(textConnection(d1), header=TRUE, as.is=TRUE)
> print (xd1); str (xd1)
>
> #This code works
> xout1 <- regtol.int (reg=lm (formula=ylnant ~ xlndur, data=xd1),  alpha=.05, P=0.99, side=2)
> print (xout1)
>
>
> #This code does not work
> xout2 <- regtol.int (reg=lm (formula=ylnant ~ xlndur, data=xd1), new.xlndur = NULL,  alpha=.05, P=0.99, side=2)

Come on, start using your brain and replace new.xlndur by new.x?

> print (xout2)
> #This code does not work
> plottol(xout1, x=cbind(1,x), y=y, side="two", x.lab="X", y.lab="Y" )

So replace x and y appropriately?

Best,
Uwe Ligges



> #This code does not work
> plottol(xout2, x=cbind(1,x), y=y, side="two", x.lab="X", y.lab="Y" )
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list