# [R] wire.frame tick labels from matrix

Date: Fri, 15 Feb 2008 10:39:26 -0900

rm(list=ls())

#Resistance

R=c(660, 548, 676, 763, 768, 692, 657, 630, 748, 680, 786, 645, 710, 677, 692, 732, 737, 651, 396,
601, 640, 448, 464, 472, 434, 487, 495, 426, 429, 456)

#Detector length

```Lend=c(37.0,  39.0,  39.0,  39.0,  40.0,  41.5,  44.0,  45.0,  46.0,  47.0,
47.0,  48.0,
48.5,  49.0,  51.0,  53.0, 53.0,  60.0,  89.0, 103.0, 108.5, 118.0, 118.0,
```
123.0,
126.0, 138.0, 139.0, 141.0, 141.0, 151.0)

#Errors to be multiplied by Restistance
x=c(0,.05,.10,.15,.20,.25)

#Errors to be multiplied by Detector length
y=c(0,.01,.02,.03,.04,.05)

#equation to predict water weight in grams
a=3.453*((Lend^2)/R)+1.994

X=(R%o%x+R)

Y=((Lend%o%y+Lend)^2)

```num.x.col <- length(X[1,])
num.y.col <- length(Y[1,])
num.rows <- length(X[,1])

```

Z <- matrix(nrow=num.rows, ncol=num.x.col*num.y.col)

for( i in 1:num.rows) {

Z[i,] <- as.vector( Y[i,] %*% t(X[i,])^-1 ) }

pred.est <- 3.453*Z+1.994
z=(pred.est-a)/a

colnames(z)<- rep(c("X1","X2","X3","X4","X5","X6"),6)

meanz=colMeans(z)
mat.x <- matrix(meanz, nrow=6, ncol=6, byrow=TRUE)

colnames(mat.x)<- c(0,1,2,3,4,5)
rownames(mat.x)<-c(0,5,10,15,20,25)
mat.x

library(lattice)
wireframe(mat.x,drape=TRUE,zlab=list("Proportion Error of Estimate", rot=90), xlab="Resistance Error (%) ",ylab="Length Error (%)",scale=list(arrows=FALSE))
detach(z)
detach(sen)

```--
Keith Cox, Ph.D.
Sitka Sound Science Center
Fisheries Biologist
P.O. Box 464

907 752-0563

[[alternative HTML version deleted]]

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help