# What statistic test use for this daily data?

Hi community

Im try to help a friend to analyses this data. Is about dry tolerance in a crop.
In the data, the white space is when the plant dead.

For understand the data, Im make somes plots.

``````library(readxl)
library(tidyverse)
library(hrbrthemes)
library(lubridate)

ACUTIF_R2\$GENOTIPO <- as.factor(ACUTIF_R2\$GENOTIPO)
ACUTIF_R2\$FECHA <- as.Date(ACUTIF_R2\$FECHA, format="%d-%b-%Y")

# General plot
ggplot(ACUTIF_R2, aes(x=FECHA,y=PESO, fill=GENOTIPO, color=GENOTIPO))+
geom_line(mapping =aes(x=FECHA,y=PESO, fill=GENOTIPO))+
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1,size = 12))+
scale_x_date(date_breaks = "1 week", date_minor_breaks = "1 week",
date_labels = "%d-%b-%Y")

# The same for others `GENOTIPO`

ggplot(subset(ACUTIF_R2,GENOTIPO=='G1'), aes(x=FECHA,y=PESO,fill=GENOTIPO)) +
geom_area(fill="#69b3a2", alpha=0.5) +
geom_line(color="#69b3a2") +
scale_y_continuous(limits=c(4200, 4700))+
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1,size = 12))+
scale_x_date(date_breaks = "1 day", date_minor_breaks = "1 day",
date_labels = "%d-%b-%Y")

#  facet_wrap `GENOTIPO`
ggplot(ACUTIF_R2, aes(x=FECHA,y=PESO,fill=GENOTIPO, color=GENOTIPO)) +
geom_line() +
scale_color_manual(values=c('#6E0069','#A56F00','#05236F','#AFD600','#DE1500'))+
scale_y_continuous(limits=c(4200, 4700))+
theme_ipsum()+
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1,size = 12))+
scale_x_date(date_breaks = "1 week", date_minor_breaks = "1 week",
date_labels = "%d-%b-%Y")+
facet_wrap(~GENOTIPO, scales = 'free')

# lm
modelo <- lm(PESO~GENOTIPO + TRATAMIENTO + FECHA, data=ACUTIF_R2)
summary(modelo)

# Call:
#   lm(formula = PESO ~ GENOTIPO + TRATAMIENTO + FECHA, data = ACUTIF_R2) # is good this?
#
# Residuals:
#   Min       1Q   Median       3Q      Max
# -284.784  -16.701    5.163   23.944  115.421
#
# Coefficients: (4 not defined because of singularities)
# Estimate Std. Error t value Pr(>|t|)
# (Intercept)     -1.837e+04  2.041e+03  -9.000  < 2e-16 ***
#   GENOTIPOG2       7.736e+01  1.268e+01   6.103 1.93e-09 ***
#   GENOTIPOG3      -3.769e+00  8.332e+00  -0.452 0.651173
#   GENOTIPOG4       2.082e+01  8.557e+00   2.434 0.015257 *
#   GENOTIPOG5      -3.613e+01  8.373e+00  -4.315 1.88e-05 ***
#   TRATAMIENTOG1P2  2.240e+01  8.332e+00   2.689 0.007380 **
#   TRATAMIENTOG1P3 -4.356e+01  8.332e+00  -5.228 2.41e-07 ***
#   TRATAMIENTOG2P1 -5.148e+00  1.735e+01  -0.297 0.766747
#   TRATAMIENTOG2P2  4.900e+01  1.551e+01   3.159 0.001670 **
#   TRATAMIENTOG2P3         NA         NA      NA       NA
#   TRATAMIENTOG3P1  1.119e+02  8.837e+00  12.664  < 2e-16 ***
#   TRATAMIENTOG3P2 -2.317e+01  8.373e+00  -2.767 0.005842 **
#   TRATAMIENTOG3P3         NA         NA      NA       NA
#   TRATAMIENTOG4P1  2.943e+01  8.557e+00   3.439 0.000627 ***
#   TRATAMIENTOG4P2 -1.925e+01  8.557e+00  -2.249 0.024875 *
#   TRATAMIENTOG4P3         NA         NA      NA       NA
#   TRATAMIENTOG5P1  9.925e+01  1.118e+01   8.875  < 2e-16 ***
#   TRATAMIENTOG5P2  9.160e+01  1.100e+01   8.330 6.06e-16 ***
#   TRATAMIENTOG5P3         NA         NA      NA       NA
#   FECHA            1.185e+00  1.056e-01  11.222  < 2e-16 ***
#   ---
#   Signif. codes:  0 โ***โ 0.001 โ**โ 0.01 โ*โ 0.05 โ.โ 0.1 โ โ 1
#
# Residual standard error: 42.49 on 570 degrees of freedom
# (194 observations deleted due to missingness)
# Multiple R-squared:  0.5396,	Adjusted R-squared:  0.5275
# F-statistic: 44.54 on 15 and 570 DF,  p-value: < 2.2e-16

``````

But dont now which statistics test use, like lm, mixed model or another.
You could suggest how make a good analyses of this data. Some links?

Time series data exhibits autocorrelation, which defeats the homoskedacity assumption of residuals assumption in OLS. For a good introduction, see the text companion to the `fpp3` package.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.