The R Project SVN R

Rev

Rev 85145 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 85145 Rev 85424
Line 1... Line 1...
1
 
1
 
2
R Under development (unstable) (2023-09-10 r85120) -- "Unsuffered Consequences"
2
R Under development (unstable) (2023-10-17 r85341) -- "Unsuffered Consequences"
3
Copyright (C) 2023 The R Foundation for Statistical Computing
3
Copyright (C) 2023 The R Foundation for Statistical Computing
4
Platform: x86_64-pc-linux-gnu
4
Platform: x86_64-pc-linux-gnu
5
 
5
 
6
R is free software and comes with ABSOLUTELY NO WARRANTY.
6
R is free software and comes with ABSOLUTELY NO WARRANTY.
7
You are welcome to redistribute it under certain conditions.
7
You are welcome to redistribute it under certain conditions.
Line 1855... Line 1855...
1855
+       zlab = "Pr(T <= t)")
1855
+       zlab = "Pr(T <= t)")
1856
> 
1856
> 
1857
> plot(function(x) dt(x, df = 3, ncp = 2), -3, 11, ylim = c(0, 0.32),
1857
> plot(function(x) dt(x, df = 3, ncp = 2), -3, 11, ylim = c(0, 0.32),
1858
+      main = "Non-central t - Density", yaxs = "i")
1858
+      main = "Non-central t - Density", yaxs = "i")
1859
> 
1859
> 
-
 
1860
> ## Relation between F_t(.) = pt(x, n) and pbeta():
-
 
1861
> ptBet <- function(t, n) {
-
 
1862
+     x <- n/(n + t^2)
-
 
1863
+     r <- pb <- pbeta(x, n/2, 1/2) / 2
-
 
1864
+     pos <- t > 0
-
 
1865
+     r[pos] <- 1 - pb[pos]
-
 
1866
+     r
-
 
1867
+ }
-
 
1868
> x <- seq(-5, 5, by = 1/8)
-
 
1869
> nu <- 3:10
-
 
1870
> pt. <- outer(x, nu, pt)
-
 
1871
> ptB <- outer(x, nu, ptBet)
-
 
1872
> ## matplot(x, pt., type = "l")
-
 
1873
> stopifnot(all.equal(pt., ptB, tolerance = 1e-15))
-
 
1874
> 
1860
> 
1875
> 
1861
> 
1876
> 
1862
> cleanEx()
1877
> cleanEx()
1863
> nameEx("Tukey")
1878
> nameEx("Tukey")
1864
> ### * Tukey
1879
> ### * Tukey
Line 9063... Line 9078...
9063
> ### * ks.test
9078
> ### * ks.test
9064
> 
9079
> 
9065
> flush(stderr()); flush(stdout())
9080
> flush(stderr()); flush(stdout())
9066
> 
9081
> 
9067
> ### Encoding: UTF-8
9082
> ### Encoding: UTF-8
9068
> 
-
 
9069
> ### Name: ks.test
9083
> ### Name: ks.test
9070
> ### Title: Kolmogorov-Smirnov Tests
9084
> ### Title: Kolmogorov-Smirnov Tests
9071
> ### Aliases: ks.test ks.test.default ks.test.formula
9085
> ### Aliases: ks.test ks.test.default ks.test.formula
9072
> ### Keywords: htest
9086
> ### Keywords: htest
9073
> 
9087
>