0% found this document useful (0 votes)
11 views7 pages

Cyclops Script R

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views7 pages

Cyclops Script R

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

cyclopsscriptr.

Davi

2024-11-17

#vitor davi cavalcanti maia


#Efeito de detergente no crescimento de 3 clones de Cyclops.

#carregando pacotes e dados


library(readxl)
library(RT4Bio)

## Carregando pacotes exigidos: MASS

## Carregando pacotes exigidos: survival

library(phia)

## Warning: pacote ’phia’ foi compilado no R versão 4.4.2

## Carregando pacotes exigidos: car

## Carregando pacotes exigidos: carData

Cyclops <- read_excel("C:/Users/Davi/Documents/r/Cyclops.xlsx")


View(Cyclops)
Cyclops$Detergente = as.factor(Cyclops$Detergente)
Cyclops$Cyclops = as.factor(Cyclops$Cyclops)
summary(Cyclops)

## TaxaCresc Detergente Cyclops


## Min. :1.762 MarcaA:9 Clone1:12
## 1st Qu.:2.583 MarcaB:9 Clone2:12
## Median :3.955 MarcaC:9 Clone3:12
## Mean :4.018 MarcaD:9
## 3rd Qu.:5.274
## Max. :6.918

#analises Exploratorias
tapply(Cyclops$TaxaCresc, Cyclops$Detergente, mean)

## MarcaA MarcaB MarcaC MarcaD


## 4.107857 4.108972 4.094704 3.760259

1
tapply(Cyclops$TaxaCresc, Cyclops$Cyclops, mean)

## Clone1 Clone2 Clone3


## 2.811777 5.347990 3.894077

tapply(Cyclops$TaxaCresc, Cyclops$Detergente, mean)

## MarcaA MarcaB MarcaC MarcaD


## 4.107857 4.108972 4.094704 3.760259

tapply

## function (X, INDEX, FUN = NULL, ..., default = NA, simplify = TRUE)
## {
## FUN <- if (!is.null(FUN))
## match.fun(FUN)
## if (inherits(INDEX, "formula")) {
## if (is.data.frame(X))
## INDEX <- .formula2varlist(INDEX, X)
## else stop("’X’ must be a data frame when ’INDEX’ is a formula")
## }
## if (!is.list(INDEX))
## INDEX <- list(INDEX)
## INDEX <- lapply(INDEX, as.factor)
## nI <- length(INDEX)
## if (!nI)
## stop("’INDEX’ is of length zero")
## if (!is.object(X) && !all(lengths(INDEX) == length(X)))
## stop("arguments must have same length")
## namelist <- lapply(INDEX, levels)
## extent <- lengths(namelist, use.names = FALSE)
## cumextent <- cumprod(extent)
## if (cumextent[nI] > .Machine$integer.max)
## stop("total number of levels >= 2^31")
## storage.mode(cumextent) <- "integer"
## ngroup <- cumextent[nI]
## group <- as.integer(INDEX[[1L]])
## if (nI > 1L)
## for (i in 2L:nI) group <- group + cumextent[i - 1L] *
## (as.integer(INDEX[[i]]) - 1L)
## if (is.null(FUN))
## return(group)
## levels(group) <- as.character(seq_len(ngroup))
## class(group) <- "factor"
## ans <- split(X, group)
## names(ans) <- NULL
## index <- as.logical(lengths(ans))
## ans <- lapply(X = ans[index], FUN = FUN, ...)
## ansmat <- array(if (simplify && all(lengths(ans) == 1L)) {
## ans <- unlist(ans, recursive = FALSE, use.names = FALSE)
## if (is.na(default) && is.atomic(ans))
## vector(typeof(ans))

2
## else default
## }
## else vector("list", prod(extent)), dim = extent, dimnames = namelist)
## if (length(ans)) {
## ansmat[index] <- ans
## }
## ansmat
## }
## <bytecode: 0x0000023e7f109e60>
## <environment: namespace:base>

coresDT = c("blue", "red", "green", "pink", "MarcaA",


"MarcaB",
"MarcaC", "MarcaD")
boxplot(Cyclops$TaxaCresc ~ Cyclops$Detergente,
ylab = "Taxa de crescimento", xlab = "Marca do detergente",
col = coresDT,
border = "white",
whiskcol = "black",
staplecol = "black",
medcol = "white",
boxwex = 0.5,
names = c("A","B", "C", "D"))
7
6
Taxa de crescimento

5
4
3
2

A B C D

Marca do detergente

3
coresCYPS = c("blue", "red", "pink","Clone1", "Clone2",
"Clone3")
boxplot(Cyclops$TaxaCresc ~ Cyclops$Cyclops,
ylab = "Taxa de crescimento", xlab = "Cyclops",
col = coresCYPS,
border = "white",
whiskcol = "black",
staplecol = "black",
medcol = "white",
boxwex = 0.5,
names = c("Clone 1","Clone 2", "Clone 3"))
7
6
Taxa de crescimento

5
4
3
2

Clone 1 Clone 2 Clone 3

Cyclops

#anova e modelo
modeloc = glm (Cyclops$TaxaCresc ~ Cyclops$Detergente *
Cyclops$Cyclops)
anova (modeloc, test = "F")

## Analysis of Deviance Table


##
## Model: gaussian, link: identity
##
## Response: Cyclops$TaxaCresc
##
## Terms added sequentially (first to last)
##

4
##
## Df Deviance Resid. Df Resid. Dev F
## NULL 35 76.493
## Cyclops$Detergente 3 0.798 32 75.695 0.4132
## Cyclops$Cyclops 2 38.870 30 36.824 30.1924
## Cyclops$Detergente:Cyclops$Cyclops 6 21.375 24 15.449 5.5343
## Pr(>F)
## NULL
## Cyclops$Detergente 0.745020
## Cyclops$Cyclops 2.801e-07 ***
## Cyclops$Detergente:Cyclops$Cyclops 0.001018 **
## ---
## Signif. codes: 0 ’***’ 0.001 ’**’ 0.01 ’*’ 0.05 ’.’ 0.1 ’ ’ 1

rdiagnostic(modeloc)

Gaussian Model Gaussian Model


Normal Q−Q plot Residuals vs Fitted
Std. deviance resid.
3

Pearson Residuals
1.5
27
6
1

0.0
−1

−1.5

25
−3

−2 0 1 2 3 4 5 6
Theoretical Quantiles Predicted values

media.crescimento = interactionMeans(modeloc)
contraste.media.crescimento.dt= testInteractions(modeloc,
pairwise =
c("Cyclops$Detergente"), fixed = "Cyclops$Cyclops")

## Warning in rbind(deparse.level, ...): number of columns of result, 5, is not a


## multiple of vector length 4 of arg 2

5
plot(media.crescimento)
contraste.teste.media.cyclops = testInteractions(modeloc,
pairwise =
c("Cyclops$Cyclops"), fixed = "Cyclops$Detergente")

## Warning in rbind(deparse.level, ...): number of columns of result, 5, is not a


## multiple of vector length 4 of arg 2

plot(media.crescimento, atx = "Cyclops$Cyclops", traces =


"Cyclops$Detergente", las = 1)

adjusted mean
6

Cyclops$Detergente
5

MarcaA
MarcaB
4

MarcaC
MarcaD
3
2
6

Cyclops$Cyclops
5

Clone1
Clone2
4

Clone3
3
2

MarcaA MarcaB MarcaC MarcaD Clone1 Clone2 Clone3


Cyclops$Detergente Cyclops$Cyclops

6
adjusted mean

5 Cyclops$Detergente
MarcaA
MarcaB
4 MarcaC
MarcaD

Clone1 Clone2 Clone3


Cyclops$Cyclops

You might also like