File: noeff.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-- 473 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
with(trawl, {

ind <- (Year == 1 & Zone == 1 & !is.na(Depth))
y <- Score1[ind]
x <- Depth[ind]
model <- sm.regression(x, y, h = 5, display = "none",
	eval.points = x)
rss.obs <- sum((y - model$estimate)^2)

p <- 0
for (i in 1:100) {
   z <- sample(y)
   model <- sm.regression(x, z, h = 5, display = "none",
   	eval.points = x)
   rss <- sum((z - model$estimate)^2)
   if (rss < rss.obs) p <- p + 1
   cat(i," ")
   }
cat("\nEmpirical p-value: ", round(p/100, 2),"\n")
})