File: smackgam.q

package info (click to toggle)
sm 2.2-6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,540 kB
  • sloc: f90: 259; ansic: 21; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 768 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
library(gam)
Presence <- smacker$Density
Presence[Presence > 0] <- 1
position <- cbind(Latitude=smacker$smack.lat, Longitude=smacker$smack.long)
Log.depth <- log(smacker$smack.depth)
temperature <- smacker$Temperature
model1 <- gam(Presence ~ lo(position) + lo(Log.depth)
              + lo(temperature), family = binomial)
model2 <- gam(Presence ~ lo(position) + lo(temperature),
              family = binomial)
model3 <- gam(Presence ~ lo(position) + lo(Log.depth),
              family = binomial)
model4 <- gam(Presence ~ lo(Log.depth) + lo(temperature),
              family = binomial)
print(anova(model1))
par(mfrow=c(2,2))
sm.regression(position, Presence, h=c(0.3, 0.3), poly.index=0,
              zlim = c(0,0.8))
plot(model1, se = TRUE)
par(mfrow=c(1,1))