rperiodicity

Interpretation of Wald test in modelling periodic data (cosinor package)


I'm using the cosinor library to fit a model using the built-in dataset

library(cosinor)
fit <- cosinor.lm(Y ~ time(time) + X + amp.acro(X), data = vitamind, period = 12)

Now to test if the X variable contributes to the model I used

test_cosinor(fit, "X", param = "amp")
test_cosinor(fit, "X", param = "acr")

As explained in the documentation

https://cran.r-project.org/web/packages/cosinor/cosinor.pdf

This function performs a Wald test comparing the group with co-variates equal to 1 to the group with covariates equal to 0.

If I understand it right, if p< 0.05 the X variable does not contribute to the model so for example if X = 1 are men and X = 0 women this means that the model is "similar" for both men and women, that mean and women do not follow a different pattern during the period studied, is this correct?

And my second question is what would be the interpretation if p < 0.05 for "amp" and p > 0.05 for "acr". I think that both should be significant for the variable to contribute to the model, is this right?


Solution

  • I am not familiar with the cosinor library, but I am pretty sure the p-value can be interpreted the same as for most other statistical methods.

    In statistics, the p-value is the probability of obtaining results at least as extreme as the observed results of a statistical hypothesis test, assuming that the null hypothesis is correct. Investopedia

    A p-value of 0.05 means that the probability of observing these results given that the null Hypothesis is true is 5%.

    So if the p-value is smaller than 0.05 we often reject the null-hyothesis because the probability of it being true is smaller than 5%.

    In general if p>0.05 it means that x does not have a statistically significant impact on y. On the other hand if p<0.05 x does have a statistically significant impact on y

    So if X=1 are men, X=0 are women and p<0.05 there is a statistically significant impact of gender on y.

    If p< 0.05 for amp this would mean that amp also has a statistically significant impact on y. Since the p-value for acr is higher than 0.05 it does not have a statistically significant impact on y.

    Be aware though that 0.05 is just a threshold that is often arbitrarily chosen and became common practice with time.