[R] the format of the result

2005-07-01 Thread khobson




See ?sprintf

#e.g. Replace your prop line with:
prop-sprintf(%.2f%%, prop.table(ta)*100)

_
mailto:[EMAIL PROTECTED]
Kenneth Ray Hobson, P.E.
Oklahoma DOT - QA  IAS Manager
200 N.E. 21st Street
Oklahoma City, OK  73105-3204
(405) 522-4985, (405) 522-0552 fax

Visit our website at:
http://www.okladot.state.ok.us/materials/materials.htm

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] R integration with Microsoft Powerpoint

2005-07-01 Thread khobson




Sure.  Just run R in a BAT file.  You just reference the BAT file in
PowerPoint like any other EXE application via an OLE link.   Of course you
can always use VBA code in Powerpoint to Shell() to the BAT program.

In R, type ?BATCH to see how the BAT file's content line should be coded to
run the R program.

mailto:[EMAIL PROTECTED]
Kenneth Ray Hobson, P.E.
Oklahoma DOT - QA  IAS Manager
200 N.E. 21st Street
Oklahoma City, OK  73105-3204
(405) 522-4985, (405) 522-0552 fax

Visit our website at:
http://www.okladot.state.ok.us/materials/materials.htm

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] R integration with Microsoft Powerpoint

2005-07-01 Thread khobson




Of course there are many ways to do it.

The user input could come from R dialogs via the tcltk package or the
Input() dialogs from VBA in Powerpoint.

I chose the output as PDF.  The R source code called cars.r, might go
something like:

pdf(file=paste(getwd(), /, cars.pdf, sep=),
  width = 8.5, height = 11, onefile = TRUE, family = Helvetica,
title = R Graphics Output, fonts = NULL, version = 1.1)
plot(cars)
lines(lowess(cars))
graphics.off()
shell(paste(getwd(), /, cars.pdf, sep=),wait=FALSE) #veiw PDF
stop(all done)

The cars.bat file, might go something like:

C:\Program Files\R\rw2010\bin\R.exe CMD BATCH c:\myfiles\r\cars.r
#Change the drives and paths to R.exe and the cars.r files.

The cars.bat file was played from PowerPoint by creating the object and
doubleclicking in the slideshow.  The are other ways to do it of course.
In PowerPoint, click the menu item Insert | Object | Create and browse to
and select the cars.r file.  I set the object as an icon and used the R.exe
icon.

VBA scripting to play the cars.bat file is not all that involved either.
___
mailto:[EMAIL PROTECTED]
Kenneth Ray Hobson, P.E.
Oklahoma DOT - QA  IAS Manager
200 N.E. 21st Street
Oklahoma City, OK  73105-3204
(405) 522-4985, (405) 522-0552 fax

Visit our website at:
http://www.okladot.state.ok.us/materials/materials.htm

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] R integration with Microsoft Powerpoint

2005-07-01 Thread khobson




...snip...In PowerPoint, click the menu item Insert | Object | Create and
browse to
and select the cars.r file. ...snip...
In the previous post snippet above, replace cars.r with cars.bat.

To run the cars.bat program via VBA, I would typically insert a button.  To
do so in PowerPoint, right click the toolbar, select Control Toolbar and
then click the button icon.  Right click and drag and draw the button onto
the slide.  Double click the button object and add code something like:

Private Sub CommandButton1_Click()
Shell (c:\myfiles\r\cars.bat)
End Sub

When passing input to a program like R, I typically use VBA's Input() and
write the results to a TXT file.  This is then easily read into R.

mailto:[EMAIL PROTECTED]
Kenneth Ray Hobson, P.E.
Oklahoma DOT - QA  IAS Manager
200 N.E. 21st Street
Oklahoma City, OK  73105-3204
(405) 522-4985, (405) 522-0552 fax

Visit our website at:
http://www.okladot.state.ok.us/materials/materials.htm

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] how to call egarch of sas in R

2005-06-30 Thread khobson




From past posts:
There are a number of GARCH models available in the fSeries package --
including models with t an skew-t distributions.

mailto:[EMAIL PROTECTED]
Kenneth Ray Hobson, P.E.
Oklahoma DOT - QA  IAS Manager
200 N.E. 21st Street
Oklahoma City, OK  73105-3204
(405) 522-4985, (405) 522-0552 fax

Visit our website at:
http://www.okladot.state.ok.us/materials/materials.htm

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] where can i download the metrics package

2005-06-28 Thread khobson




Look for package Ecdat.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Stop Warnings for Invalid Factor Level, NAs generated?

2005-06-23 Thread khobson




How can I stop the following warning from occuring?
invalid factor level, NAs generated in: [-.factor(`*tmp*`, iseq, value =
structure(1, .Label = 12, class = factor))

The Label messages are for 5, 8, 12 and 46. I want the NAs to be
generated as needed.

Is this causing R to slow down by generating the warning messages?  There
are over 50.  I loop through up to 10 datasets and append one row from each
to create a summary dataset.

The full code and data is too long to post.  The snippet below might
explain what I'm doing somewhat.  I'll work up some sample data and code if
no solutions are found.

...snip
 # Get info on first and last pair sets and lab names in last pair
 nlabs - labdata[[LABNUMBER]] #e.g. 1, 2, 5, 6, ...
 nolabs - length(nlabs) #Total number of labs in last pair of labdata
 #dpdata - labdata[which(labdata[[LABNUMBER]] == 13),] #Dummy paired
data row
 dpdata - rbind(labdata[0,], NA)
 pdata - dpdata
 # Loop through pairs of labdata to build pdata for pairs (last 10 years
or less)
 k=0
 for(j in nlabs){
+   for(i in ifpair:ilpair){
+ k - k + 1  #Counter for number of pairs.  Start at 1.
+ setwd(dirs[i]); load(labdata.Rdata)#No trailing / in wd
+ setwd(cdir) #Go back to original ESN pair (last pair's folder in
analysis)
+ tpdata - labdata[which(labdata[[LABNUMBER]] == j),]
+ if(NROW(tpdata) == 0){
+   tpdata - dpdata
+   tpdata[which(names(labdata) == LABNUMBER)] - j
+   tpdata[which(names(labdata) == ESN)] -
ESN-((ilpair-ifpair)+1-k)*2
+ tpdata[which(names(labdata) == ESNm1)] -
ESN-((ilpair-ifpair)+1-k)*2-1
+ }
+   #pdata[nrow(pdata)+1,names(tpdata)] - NA
+   pdata[nrow(pdata)+1,names(tpdata)] - tpdata
+   }
+ }
There were 50 or more warnings (use warnings() to see the first 50)
...snip

mailto:[EMAIL PROTECTED]
Kenneth Ray Hobson, P.E.
Oklahoma DOT - QA  IAS Manager
200 N.E. 21st Street
Oklahoma City, OK  73105-3204
(405) 522-4985, (405) 522-0552 fax

Visit our website at:
http://www.okladot.state.ok.us/materials/materials.htm

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Excel files first row not being read

2005-06-16 Thread khobson




If you would post your R code and explain how a simple Excel matrix is set
up, we might be able to help more.

khobson at odot.org
Kenneth Ray Hobson, P.E.
Oklahoma DOT - QA  IAS Manager
200 N.E. 21st Street
Oklahoma City, OK  73105-3204
(405) 522-4985, (405) 522-0552 fax

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Default Format for Dates?

2005-06-10 Thread khobson




Is there anyway to preset date formats?  I have a date from a cover.dbf
that is shown as this:
 cover$FINALREPOR
[1] 2003-06-24

The numeric value in cover$FINALREPOR is 12227.  I'd rather not create
another vector to hold the properly formatted date.

When I put this in a WordPerfect merge, I want the date to be June 24,
2003.   I could take care of the problem in a WordPerfect macro but I'd
rather do it as an R default date format if possible.

I researched some of this in the archives, FAQ's and manuals but didn't
find anything that met my need.  I would imagine that this type of question
is probably an FAQ but I didn't find it.

mailto:[EMAIL PROTECTED]
Kenneth Ray Hobson, P.E.
Oklahoma DOT - QA  IAS Manager
200 N.E. 21st Street
Oklahoma City, OK  73105-3204
(405) 522-4985, (405) 522-0552 fax

Visit our website at:
http://www.okladot.state.ok.us/materials/materials.htm

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Add Columns and Order for Rbind?

2005-05-31 Thread khobson




I am using rbind to add one list with one row to another master list.  The
problem is that not all columns exist in both lists.

What methods would you recommend to reorder one list based on the column
names of another?   If both sets have the same order and columns, I can
then use rbind.  I can live with columns being added to the master list set
it makes the task easier using something like union for column name
matching and order.

mailto:[EMAIL PROTECTED]
Kenneth Ray Hobson, P.E.
Oklahoma DOT - QA  IAS Manager
200 N.E. 21st Street
Oklahoma City, OK  73105-3204
(405) 522-4985, (405) 522-0552 fax

Visit our website at:
http://www.okladot.state.ok.us/materials/materials.htm

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Missing Data Line Type?

2005-05-24 Thread khobson




I have a general question.  Is there a setting that can be used for a
multiple line type?  The situation is that I want a solid line between x
and y points but if the y point is missing, I want a dashed line type to
the next point.  In other words, if point 1 to 2 exists, make that line
solid, otherwise, make it dashed up to the next existing x/y point.

Additionally, what plot type would you recommend for a plot with two Y
points per X?  The two points would be joined by a vertical line.  The
average of the two is the dual type line described above.

mailto:[EMAIL PROTECTED]
Kenneth Ray Hobson, P.E.
Oklahoma DOT - QA  IAS Manager
200 N.E. 21st Street
Oklahoma City, OK  73105-3204
(405) 522-4985, (405) 522-0552 fax

Visit our website at:
http://www.okladot.state.ok.us/materials/materials.htm

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] List and Column Names in a Function?

2005-05-13 Thread khobson




In this simple function, how can I pass strings for index and column names
to the function?  I've posted this type of question before and received no
response.

Maybe this example will be easier to understand and troubleshoot.

ds - function(myds, vec) {myds[[vec]]*2}

ds1 - c(X=list(1:10), Y=list(11:20))

ds(get(ds1),get(Y))


[EMAIL PROTECTED]
Kenneth Ray Hobson, P.E.
Oklahoma DOT - QA  IAS Manager
Oklahoma City, OK  73105-3204

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Re: Re: List and Column Names in a Function?

2005-05-13 Thread khobson




The solution that Douglas proposed does not work.  Any other ideas?

 In this simple function, how can I pass strings for index and column
names
 to the function?  I've posted this type of question before and received
no
 response.

 Maybe this example will be easier to understand and troubleshoot.

 ds - function(myds, vec) {myds[[vec]]*2}

 ds1 - c(X=list(1:10), Y=list(11:20))

 ds(get(ds1),get(Y))

You are overusing the get function.  I think you can do what you want as

ds(ds1, Y)


[EMAIL PROTECTED]
Kenneth Ray Hobson, P.E.
Oklahoma DOT - QA  IAS Manager

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Re: Re: List and Column Names in a Function?

2005-05-13 Thread khobson




The R-Help replies inspired me to try ds(get(ds1), Y) which solves my
problem.

What I wanted was to pass string values for both the list name and the
column name.  I had tried several methods before posting.  Thanks for the
replies.

I incorrectly stated that Douglas Grove's solution would not work.  (I had
a typo when I tried it).  It works as he specified but not as I required.
The results below are the expected results which I probably should have
shown to be more clear.   It did get me to a solution though.

I would not post questions if I had not read the posting guide.   I spent
lots of time viewing the R-Help archives prior to posting as well.  Two
other posts of mine had no replies.  If you see those, there is no need to
reply.  With this more simplified example and your responses, I'm now good
to go.


   
   
   
   




 From: [EMAIL PROTECTED]

 The solution that Douglas proposed does not work.  Any other ideas?

Then perhaps you could (re-)read the posting guide, and give us more
information on what you mean by does not work, and exactly what you are
expecting?  Isn't this what you want?


 ds1 - c(X=list(1:10), Y=list(11:20))
 ds - function(myds, vec) myds[[vec]] * 2
 ds(ds1, Y)
 [1] 22 24 26 28 30 32 34 36 38 40

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Need help with vector designations in a Function

2005-05-12 Thread khobson




My function works fine if the X and Y exist in the T314 data.  How can I
code the macro to allow vector designations in the function different than
X and Y?  Maybe something to do with environment?

rm(list=ls())

# Data from NCHRP Appendix A -
http://trb.org/publications/nchrp/nchrp_w71.pdf
T314 - structure(list(Lab = as.integer(c(1:60)), X = c(4.89, 3.82, 2.57,
2.3,2.034, 2, 1.97, 1.85,1.85, 1.85, 1.84, 1.82, 1.82, 1.77, 1.76, 1.67,
1.66,
1.63, 1.62,1.62, 1.55, 1.54, 1.54, 1.53, 1.53, 1.44, 1.428, 1.42, 1.39,
1.36,
1.35, 1.31, 1.28, 1.24, 1.24, 1.23, 1.22, 1.21, 1.19, 1.18, 1.18, 1.18,
1.17,
1.16, 1.13, 1.13, 1.099, 1.09, 1.09, 1.08, 1.07, 1.05, 0.98, 0.97, 0.84,
0.808,
0.69, 0.63, 0.6, 0.5), Y = c(5.28, 3.82, 2.41, 2.32, 2.211, 1.46, 2.24,
1.91,
1.78, 1.63, 1.81, 1.92, 1.2, 1.67, 1.28, 1.59, 1.45, 2.06, 1.91, 1.19,
1.26,
1.79, 1.39, 1.48, 0.72, 1.29, 1.517, 1.71, 1.12, 1.38, 0.93, 1.36, 1.2,
1.23,
0.71, 1.29, 1.26, 1.48, 1.26, 1.33, 1.21, 1.04, 1.57, 1.42, 1.08, 1.04,
1.33,
1.33, 1.2, 1.05, 1.24, 0.91, 0.99, 1.06, 1.27, 0.702, 0.77, 0.58, 1,
0.38)),
.Names = c(Lab, X, Y ), class = data.frame,
row.names = as.character(c(1:60)))

### Be sure to remove NA data prior to oOut()
oOut - function(dsin, dsout, X, Y)
  {
  oOutsub - function(olimit){
# Get Medians for Invalid Data Determination
Xmed - median(dsin$X); Ymed - median(dsin$Y)
# Make new dataset with (Y-X)-(Ymedian-Xmedian) column
dsout - cbind(dsin, XY=(dsin$Y-dsin$X)-(Ymed-Xmed))
# Get median for new column
XYmed - median(dsout$XY)
iqx - diff(quantile(dsin$X, c(0.125, .875)))
iqy - diff(quantile(dsin$Y, c(0.125, .875)))
iqxy - diff(quantile(dsout$XY, c(0.125, .875)))
# Invalid Upper Limits
iulX - quantile(dsin$X, 0.875)+olimit*iqx

iulY - quantile(dsin$Y, 0.875)+olimit*iqy
iulXY - quantile(dsout$XY, 0.875)+olimit*iqxy
# Invalid Lower Limits
illX - quantile(dsin$X, 0.125)-olimit*iqx
illY - quantile(dsin$Y, 0.125)-olimit*iqy
illXY - quantile(dsout$XY, 0.125)-olimit*iqxy

dsout - subset(dsout, with(dsout, X = iulX  X = illX))
dsout - subset(dsout, with(dsout, Y = iulY  Y = illY))
dsout - subset(dsout, with(dsout, XY = iulXY  XY = illXY))
dsout
}
  dsout - oOutsub(1.555)  #Eliminates Invalid Data
  dsin - dsout
  dsout - oOutsub(0.674)  #Eliminates Outlier Data
  dsout - dsout[1:(ncol(dsout)-2)]  #Trim outer 2 XY columns
  dsout
  }

T314.o - oOut(T314, T314.o, X, Y)
T314.o # showing resutls.  Notice 2nd XY name

cv - function(x)
{
sd(x)/(mean(x))*100
}

T314 - cbind(T314, X.mean=mean(T314$X))
T314 - cbind(T314, X.sd=sd(T314$X))
T314 - cbind(T314, X.cv=cv(T314$X))
T314 - cbind(T314, Y.count=NROW(T314$Y))
T314 - cbind(T314, Y.mean=mean(T314$Y))
T314 - cbind(T314, Y.sd=sd(T314$Y))
T314 - cbind(T314, Y.cv=cv(T314$Y))

T314.o - cbind(T314.o, X.mean=mean(T314.o$X))
T314.o - cbind(T314.o, X.sd=sd(T314.o$X))
T314.o - cbind(T314.o, X.cv=cv(T314.o$X))
T314.o - cbind(T314.o, Y.count=NROW(T314.o$Y))
T314.o - cbind(T314.o, Y.mean=mean(T314.o$Y))
T314.o - cbind(T314.o, Y.sd=sd(T314.o$Y))
T314.o - cbind(T314.o, Y.cv=cv(T314.o$Y))

T314.o - cbind(T314.o, ElimLabs=paste(setdiff(T314$Lab, T314.o$Lab),
collapse=, ))
# Number of standard deviations
T314.o - cbind(T314.o, X.nsd=(T314.o$X-T314.o$X.mean)/T314.o$X.sd)
T314.o - cbind(T314.o, Y.nsd=(T314.o$Y-T314.o$Y.mean)/T314.o$Y.sd)
# X Ratings next
T314.o-cbind(T314.o, X.rate=NA)
for (i in 1:nrow(T314.o))
{s-ifelse(T314.o$X.nsd[i]0,-1,1)
if(abs(T314.o$X.nsd[i])1) T314.o$X.rate[i]=s*5
if(abs(T314.o$X.nsd[i])=1  T314.o$X.nsd[i]1.5) T314.o$X.rate[i]=s*4
if(abs(T314.o$X.nsd[i])=1.5  T314.o$X.nsd[i]2) T314.o$X.rate[i]=s*3
if(abs(T314.o$X.nsd[i])=2  T314.o$X.nsd[i]2.5) T314.o$X.rate[i]=s*2
if(abs(T314.o$X.nsd[i])=2.5  T314.o$X.nsd[i]3) T314.o$X.rate[i]=s*1
if(abs(T314.o$X.nsd[i])=3) T314.o$X.rate[i]=0
}
# Y Ratings next
T314.o-cbind(T314.o, Y.rate=NA)
for (i in 1:nrow(T314.o))
{s-ifelse(T314.o$Y.nsd[i]0,-1,1)
if(abs(T314.o$Y.nsd[i])1) T314.o$Y.rate[i]=s*5
if(abs(T314.o$Y.nsd[i])=1  T314.o$Y.nsd[i]1.5) T314.o$Y.rate[i]=s*4
if(abs(T314.o$Y.nsd[i])=1.5  T314.o$Y.nsd[i]2) T314.o$Y.rate[i]=s*3
if(abs(T314.o$Y.nsd[i])=2  T314.o$Y.nsd[i]2.5) T314.o$Y.rate[i]=s*2
if(abs(T314.o$Y.nsd[i])=2.5  T314.o$Y.nsd[i]3) T314.o$Y.rate[i]=s*1
if(abs(T314.o$Y.nsd[i])=3) T314.o$Y.rate[i]=0
}

mailto:[EMAIL PROTECTED]
Kenneth Ray Hobson, P.E.
Oklahoma DOT - QA  IAS Manager
200 N.E. 21st Street
Oklahoma City, OK  73105-3204
(405) 522-4985, (405) 522-0552 fax

Visit our website at:
http://www.okladot.state.ok.us/materials/materials.htm

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Windows List of Folders?

2005-04-29 Thread khobson




For windows, how can I list only the folders in some folder?
I was thinking that dir() and file.info() with isdir==TRUE being something
that might work.

These folders or directories are numerically named with no dot extension
names or other characters.  Typically, these are 3132, 3334, ...

Here is what I tried.  The last line is where I need more work.

pData=C:/Myfiles/R/Data/
setwd (pData)
x - dir(pData, all.files=F)
y - file.info(x, x$isdir==T)

TIA

Kenneth Ray Hobson, P.E.
Oklahoma DOT - QA  IAS Manager
200 N.E. 21st Street
Oklahoma City, OK  73105-3204

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Hoaglin Outlier Method

2005-04-22 Thread khobson




I am a new user of R so please bear with me.  I have reviewed some R books,
FAQs and such but the volume of material is great.  I am in the process of
porting my current SAS and SVS Script code to Lotus Approach, R and
WordPerfect.

My question is, can you help me determine the best R method to implement
the Hoaglin Outlier Method?  It is used in the Appendix A and B of the fo
llowing link. http://trb.org/publications/nchrp/nchrp_w71.pdf

The sample data from Appendix A for determining outliers in R:
T314Data -
structure(list(Lab = as.integer(c(1:60)), X = c(4.89, 3.82, 2.57, 2.3,
2.034, 2, 1.97, 1.85,
1.85, 1.85, 1.84, 1.82, 1.82, 1.77, 1.76, 1.67, 1.66, 1.63, 1.62,
1.62, 1.55, 1.54, 1.54, 1.53, 1.53, 1.44, 1.428, 1.42, 1.39,
1.36, 1.35, 1.31, 1.28, 1.24, 1.24, 1.23, 1.22, 1.21, 1.19, 1.18,
1.18, 1.18, 1.17, 1.16, 1.13, 1.13, 1.099, 1.09, 1.09, 1.08,
1.07, 1.05, 0.98, 0.97, 0.84, 0.808, 0.69, 0.63, 0.6, 0.5), Y = c(5.28,
3.82, 2.41, 2.32, 2.211, 1.46, 2.24, 1.91, 1.78, 1.63, 1.81,
1.92, 1.2, 1.67, 1.28, 1.59, 1.45, 2.06, 1.91, 1.19, 1.26, 1.79,
1.39, 1.48, 0.72, 1.29, 1.517, 1.71, 1.12, 1.38, 0.93, 1.36,
1.2, 1.23, 0.71, 1.29, 1.26, 1.48, 1.26, 1.33, 1.21, 1.04, 1.57,
1.42, 1.08, 1.04, 1.33, 1.33, 1.2, 1.05, 1.24, 0.91, 0.99, 1.06,
1.27, 0.702, 0.77, 0.58, 1, 0.38)), .Names = c(Lab, X, Y
), class = data.frame, row.names = c(1, 2, 3, 4, 5,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60
))

From this point on, I could use your advise.  There are several other
methods for determining outliers in R.  I'd rather not re-invent the wheel
or use a brute strength and force method if there is a better way in R.

Our usual method for determining outliers is a student's T test as in ASTM
E 178 or when the standard deviation for a lab is 3 or more.  We normally
have 120 labs to evaluate for outliers similar what is shown in T312Data.
On occasion, I have used the Wilk-Shapiro W statistic in SAS.  A point in
the right direction or an R code example would help greatly.  After I trim
the outliers, I will need to show which labs were eliminated but that
should be fairly trivial.

The reference in Appendix A is:
Hoaglin, D. C., Iglewicz, B., Tukey, J. W., Performance of Some Resistant
Rules for Outlier Labeling, Journal
of the American Statistical Association, Vol. 81, No. 396 (Dec., 1986), pp.
991-999.

The ASTM E 178 reference is:
Shapiro, S. S., and Wilk, M. B., An Analysis of Variance Test for
Non-Normality (Complete Samples), Biometrika, BIOKA, Vol 52,
1965, pp. 591611.

Kenneth Ray Hobson, P.E.
Oklahoma DOT - QA  IAS Manager
200 N.E. 21st Street
Oklahoma City, OK  73105-3204
(405) 522-4985, (405) 522-0552 fax

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html