統計解析R たぶんpart3くらい (587レス)
前次1-
抽出解除 レス栞

リロード規制です。10分ほどで解除するので、他のブラウザへ避難してください。
17: uy 2012/06/24(日)18:16:28.30 AAS
俺はゴミカスだがエリートゴミカスでR
お前らのような下級ゴミカスとは格が違うのでR
84: 83 2014/07/15(火)10:02:10.30 ID:zeQtrZTc(2/2) AAS
突っ込まれる前に追記。
もちろん、下記のようにすれば、ある程度実現することは分かっているけど、
ちゃんとレイアウトされた表にすることが難しい
x <- data.frame(x = runif(10), y = runif(10))
plot(x, xlim = c(0, 1.5), cex=2)
i <- 1:10
text(x, as.character(i))
legend("topright", paste(formatC(1:10, width=2),
month.name[i]), title = "Month", bty = "n")
188: 2018/02/25(日)16:50:33.30 ID:3M2goUSG(1) AAS
具体的な話を聞くと便利そうな気がしてくる
やっぱりRStudioがベストなのかもね
しばらく使ってみようかな、ありがとう
279: 2019/06/09(日)01:59:10.30 ID:wNZZZJ2C(2/3) AAS
青の分布を赤の分布に連続的に変形させる [so-2]{#so-2}

``` {r}
big_data = with (c (big_data, nx = 2e+3, nt = 1e+3, alim = 2, blim = 4), {
vec = function (x, t) { (Pa (x) - Pb (x)) / ((1 - t) * pa (x) + t * pb (x));
}; t = seq (0, 1, len = nt); dt = diff (t) %>% mean; x = ra (nx); x = x0 =
x [which (abs (x) <= alim)]; x = purrr::map (t, function (t) { x <<- x +
dt * vec (x, t); }) %>% do.call (what = rbind); draw = function (t, x,
nbin = 20 , vector = null) { xlim = range (x, na.rm = true); plot ( xlim,
range (t), type = 'n', main = 'trajectories', xlab = 'x', ylab = 't');
purrr::map ( sample (1 : ncol (x), 50), function (j) { x = x [, j]; if (
all ( is.finite (x))) { lines (x, t); } else { points (x, t); }; }); if (
is.function (vector)) { no_plot (); }; doit = function (ind) { t = t [ind];
x = x [ind, ]; if (is.null (nbin)) { nbin = 'scott'; }; msg = sprintf (
'at the time %.1e', t); msg = c (msg, sprintf ('%d / %d', sum ( xlim [1] <=
abs (x) & abs (x) <= xlim [2], na.rm = true), size (x))); hist (x, breaks =
nbin, freq = false, xlim = xlim, main = msg); x = seq ( xlim [1], xlim [2],
len = 1e+3);
# lines (x, pa (x), col = 'blue');
lines (x, pb (x), col = 'red'); if (is.function (vector)) { x = seq (min (
xlim), max (xlim), len = 1e+5); plot (x, vector (t, x) %>% abs (), type =
'l', log = 'y', main = msg); }; }; for (i in c (1, size (t) / 2, size (
t))) { doit (i); } }; x = rbind (x0, x [- nrow (x), ]); x [which (blim <
abs (x))] = na; fix_bin = function (x, lim) { max (sum (abs (x [nrow (x)
, ]) <= lim , na.rm = true) / 50, 10) %>% as.integer (); }; draw (t, x
, nbin = fix_bin (x, blim), vector = vec); add (big_data, x0 = x0, t = t
, dt = dt , nt = nt, nx = nx, vec = vec, draw = draw, fix_bin = fix_bin
, alim = alim, blim = blim);});
```
284: 2019/06/30(日)21:38:18.30 ID:6iFXy6Q7(1) AAS
DFT行列のチェックのバグ修正+testthat+lenses

``` {r}
with (c (big_data, n = 17, N = 1e+3, get = lenses::view, set = lenses::set), {
`%.%` = function (f, g) function (x) f (g (x));
values_l = lenses::index ('values');
square = function (a) (t %.% Conj) (a) %*% a;
out = outer (1 : n, 1 : n, function (i, j) {
ij = (i * j) %% n;
k = pracma::gcd (ij, n);
angle = 2 * pi * (ij %/% k) / (n %/% k);
complex (re = cos (angle), im = sin (angle));
});
testthat::test_that ('dft', {
# testthat::expect_equal (square (out), n * pracma::eye (n));
testthat::expect_equal ((Re %.% square) (out), n * pracma::eye (n));
testthat::expect_equal ((Im %.% square) (out), pracma::zeros (n));
});
k = (n - 2) : 2;
out = purrr::map (k, function (k) {
purrr::map (1 : N, function (.) {
out = out [sample.int (n, k), sample.int (n, k)];
out = eigen (out, only = true) %>% get (values_l);
(sum %.% log) (out) - 1 / 2 * log (k);
}) %>% get (lenses::unlist_l);
}) %>% set (lenses::names_l, k);
testthat::test_that ('det', purrr::map (out, function (out) {
testthat::expect_true ((all %.% is.finite) (out));
}));
purrr::map (out, Re) %>% ggwaterfall::waterfall_ft (show.labels = true);
});
```
511: 2023/05/27(土)00:00:44.30 ID:qqVzW/zi(1) AAS
どなたか統計素人の私に教えてください

医療でA群100名とB群100名をいろんな観点から
比較するとします

背景を揃えるために傾向スコア分析で
キャリパー0.2で取って30ペア(合計60人)を抽出しました

例えば
①アミラーゼの値とかを統計にかけたいときは、その60人のアミラーゼのデータをまずは正規分布かどうかをShapiro-wilk検定で測って、0.05を上回っていたら「正規分布」と見なして、今度はこれら60人のアミラーゼのデータが等分散かどうかを確認するためにf検定を行なって等分散だったらt検定(Student's t-test)、違ったらWelch's t-testで優位差があるかどうかを調べる。

もしShapiro-wilk検定が0.05未満で非正規分布だったときはMann-whitney's U検定で優位差があるかどうかを調べる。

↑Q1. この認識であってますか?

Q2. この正規分布を計るのはペアを作った後のデータ(n=60)で、正規分布かどうか?等分散かどうか?を見ますか?
それともマッチング前のデータ(n=200)で正規分布かどうか?等分散かどうか?を確認するべきですか?

Q3. アミラーゼじゃなくて他の連続変数の項目(BMIだったり、血圧だったり、白血球数だったり)の優位差を調べる場合も
全て上の流れで一つ一つの項目ごとで正規分布か?等分散か?など確認していって適宜、該当する算出法を項目ごとに採用して優位差を測る必要がありますか?

もし良ければ教えていただけるとありがたいです
前次1-
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル

ぬこの手 ぬこTOP 0.032s