wxyz {agricolae}R Documentation

Completing missing data of a matrix according to a model

Description

It generates an information matrix z=f(x, y). It uses a linear model to complete the cells without information.

Usage

wxyz(model, x, y, z)

Arguments

model obtained by 'lm'
x vector 'x'
y vector 'y'
z vector 'z' relation of 'x' e 'y'

Value

model obtained by 'lm'
x Numeric
y Numeric
z Numeric

Author(s)

Felipe de Mendiburu

See Also

grid3p

Examples

library(agricolae)
x<-c(1,3,5,2,3,1)
y<-c(2,5,4,3,2,3)
z<-c(4,10,NA,6,7,NA)
modelo<-lm(z~x+y)
zz<-wxyz(modelo,x,y,z)
# The response surface
x<-as.numeric(rownames(zz))
y<-as.numeric(colnames(zz))
#startgraph
persp(x,y,zz, cex=0.7,theta = -20, phi = 30,shade= 0.2,nticks = 6, col = 'green' ,
ticktype = 'detailed',xlab = 'X', ylab = 'Y', zlab = 'Response')
#endgraph

[Package agricolae version 1.0-6 Index]