I have a list which contains something like the following:
$AKAM
Augmented Dickey-Fuller Test
data: Cl(.)
Dickey-Fuller = -3.6785, Lag order = 3, p-value = 0.03802
alternative hypothesis: stationary
$ALXN
Augmented Dickey-Fuller Test
data: Cl(.)
Dickey-Fuller = -2.9311, Lag order = 3, p-value = 0.2052
alternative hypothesis: stationary
I want to filter based on the p-value. I can access the p-value using: d$AKAM$p.value. I would like to filter the lists based on the criteria that the p-value is < 0.05.
Data:
d <- list(ABMD = structure(list(statistic = c(`Dickey-Fuller` = -2.88823930907752),
parameter = c(`Lag order` = 3), alternative = "stationary",
p.value = 0.222153876057991, method = "Augmented Dickey-Fuller Test",
data.name = "Cl(.)"), class = "htest"), ATVI = structure(list(
statistic = c(`Dickey-Fuller` = -2.86560166108736), parameter = c(`Lag order` = 3),
alternative = "stationary", p.value = 0.231115731952747,
method = "Augmented Dickey-Fuller Test", data.name = "Cl(.)"), class = "htest"),
ADBE = structure(list(statistic = c(`Dickey-Fuller` = -2.91292875187715),
parameter = c(`Lag order` = 3), alternative = "stationary",
p.value = 0.212379749850693, method = "Augmented Dickey-Fuller Test",
data.name = "Cl(.)"), class = "htest"), AMD = structure(list(
statistic = c(`Dickey-Fuller` = -3.46654255102478), parameter = c(`Lag order` = 3),
alternative = "stationary", p.value = 0.0592779965240372,
method = "Augmented Dickey-Fuller Test", data.name = "Cl(.)"), class = "htest"),
AKAM = structure(list(statistic = c(`Dickey-Fuller` = -3.67846516682619),
parameter = c(`Lag order` = 3), alternative = "stationary",
p.value = 0.0380202892654308, method = "Augmented Dickey-Fuller Test",
data.name = "Cl(.)"), class = "htest"), ALXN = structure(list(
statistic = c(`Dickey-Fuller` = -2.93110833009175), parameter = c(`Lag order` = 3),
alternative = "stationary", p.value = 0.205182767184581,
method = "Augmented Dickey-Fuller Test", data.name = "Cl(.)"), class = "htest"))