0
$\begingroup$

I have data consisting of the distance cats travelled each hour, collected over four or five days per cat. The cats were measured in different seasons and I want to know whether the activity of the cat varied with hour, dependent on the season. For example, were cats more nocturnal in summer? I am not sure whether the output is showing that there is a difference in the mean activity, or a difference in the pattern of activity over time?

My data is structured with the headings: Cat_ID, season, day, hour, distance.

Using the mgvc package, my GAMM model is then constructed like this:

mod1 <- gamm(distance ~ s(hour) + s(hour,by=season,bs="cc",fx=TRUE,k=6) + season, 
             random = list(id = ~1), data = dn, na.action=na.exclude)

The output is:

> summary(mod1$gam)

Family: gaussian 
Link function: identity 

Formula:
dn$distance ~ s(hour) + s(hour, by = season, bs = "cc", fx = TRUE, 
    k = 6) + season

Parametric coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept)    160.77      13.68  11.756   <2e-16 ***
seasonSummer   -15.33      18.33  -0.836    0.403    
seasonWinter   -25.49      17.74  -1.437    0.151    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Approximate significance of smooth terms:
                     edf Ref.df     F  p-value    
s(hour)                1      1 5.526 0.018769 *  
s(hour):seasonSpring   4      4 5.009 0.000499 ***
s(hour):seasonSummer   4      4 1.529 0.190775    
s(hour):seasonWinter   4      4 2.856 0.022273 *  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =     NA   
  Scale est. = 21730     n = 5226
Warning messages:
1: In as.numeric(object$y) - object$fitted.values :
  longer object length is not a multiple of shorter object length
2: In w * (as.numeric(object$y) - object$fitted.values) :
  longer object length is not a multiple of shorter object length

I want to know if the 'parametric coefficients' are telling me that there is no difference between the mean distance travelled in spring and summer (p=0.403) nor between spring and winter (p=0.151), or if there is no difference between the activity over the day, i.e. the pattern of activity.

Thank you so much for any help you can provide

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.