AjustarRegressao: Ajuste de modelos de regressao multipla

Description Usage Arguments Value References See Also Examples

View source: R/AjustarRegressao.R

Description

Esta funcao realiza o ajuste de modelos de regressao multipla considerando 2 variaveis independentes (explicativas) e uma variavel dependente (resposta). E possivel analisar dados de experimentos avaliados sem delineamento (repeticoes) e com delineamento estatistico (DIC e DBC)

Usage

1
AjustarRegressao(Dados, design,Modelos=NULL)

Arguments

Dados

Matriz contendo 3 colunas obrigatoriamente caso o design seja 1 (experimento sem repeticoes), sendo as duas primeiras as variaveis explicativas e a terceira a variavel resposta. Se houver repeticoes (Design 2 ou 3) a matriz deve conter obrigatoriamente 4 colunas, as duas primeiras com as variaveis explicativas, a terceira com a identificacao das repeticoes/blocos e a quarta coluna com a variavel resposta.

design

Indica o delineamento utilizado na pesquisa:

  • design 1 -> Experimento sem repeticao.

  • design 2 -> Experimento no delineamento inteiramente casualizado (Dic).

  • design 3 -> Experimento no delineamento em blocos casualizados (Dbc).

Modelos

Objeto do tipo list com os objetos a serem testados. Se NULL (default) sao testados 12 modelos de regressao.

Value

A funcao retorna o resultado do ajuste de modelos de regressao. Estes resultados podem ser apresentados no console, e alem disso, estao carregados em um objeto do tipo list.

References

Tutoriais onlines: https://www.youtube.com/playlist?list=PLvth1ZcREyK6OUnWVs-hnyVdCB1xuxbVs

See Also

plot2D, plot3D, predict3D

Examples

 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
61
62
63
#Exemplo 1: Experimento sem delineamento
data("Dados1")
res=AjustarRegressao(Dados = Dados1, design=1)
res
plot2D(res,niveis = 3)
plot2D(res,niveis = 3,xlab="Comprimento (cm)",ylab="Largura (cm)",
       Metodo = "simple")
plot2D(res,niveis = 5,xlab="Comprimento (cm)",ylab="Largura (cm)",
       Metodo="edge",col.contour = "blue")
plot3D(res)

##########################
#Criando paleta de cores
col0 = colorRampPalette(c('white', 'cyan', '#007FFF', 'blue','#00007F'))
col1 = colorRampPalette(c('#7F0000', 'red', '#FF7F00', 'yellow', 'white',
                         'cyan', '#007FFF', 'blue','#00007F'))
col2 = colorRampPalette(c('#67001F', '#B2182B', '#D6604D', '#F4A582',
                         '#FDDBC7', '#FFFFFF', '#D1E5F0', '#92C5DE',
                         '#4393C3', '#2166AC', '#053061'))
col3 = colorRampPalette(c('red', 'white', 'blue'))
col4 = colorRampPalette(c('#7F0000', 'red', '#FF7F00', 'yellow', '#7FFF7F',
                         'cyan', '#007FFF', 'blue', '#00007F'))

plot2D(res,niveis = 5,xlab="Comprimento (cm)",ylab="Largura (cm)",
      Metodo="edge",contour = TRUE,cor=col0(200),box=FALSE)


plot2D(res,niveis = 10,xlab="Comprimento (cm)",ylab="Largura (cm)",zlab=FALSE,
      contour = TRUE,cor=col1(200),box=TRUE,col.contour = "black",
      main="Superficie Resposta")


##############################################################################
##############################################################################
#Exemplo 2: Experimento sem delineamento
data("Dados2")
res=AjustarRegressao(Dados = Dados2, design=1)
res
plot2D(res,niveis = 10,xlab="Acucar (%)",ylab="Banana (%)",
zlab="Aceitabilidade",
      contour = TRUE,cor=col1(200),box=TRUE,col.contour = "black",
      main="Superficie Resposta")
plot3D(res)

##############################################################################
##############################################################################
#Exemplo 3: Experimento com delineamento (DIC)
data("Dados3")
res=AjustarRegressao(Dados = Dados3, design=2)
res
plot2D(res,niveis = 5, Metodo="edge",contour = FALSE)
plot2D(res,niveis = 5, Metodo="edge",contour = TRUE,col.contour = "black")
plot3D(res)
##############################################################################
##############################################################################
#Exemplo 4: Experimento com delineamento (DBC)
data("Dados3")
res=AjustarRegressao(Dados = Dados3, design=3)
res
plot2D(res,niveis = 20,xlab="N (K/ha)",ylab="K (Kg/ha)",
      Metodo="edge",contour = TRUE,cor=col1(200),box=TRUE)
plot2D(res,niveis = 5, Metodo="edge",contour = TRUE,col.contour = "black")
plot3D(res)

ExpAnalysis3d documentation built on Nov. 1, 2021, 9:06 a.m.