@numero-uno-jpn/rstats 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.ja.md +7 -5
  3. package/README.md +7 -5
  4. package/dist/chunks/{chunk-SVS54D6Z.js → chunk-2IYY74LX.js} +2 -2
  5. package/dist/chunks/{chunk-GBSMRVUY.js → chunk-2MYUAEYE.js} +2 -2
  6. package/dist/chunks/{chunk-YBOSCQF2.js → chunk-3BEE6BHN.js} +1 -1
  7. package/dist/chunks/{chunk-F6Z3GLWA.js → chunk-73QCE2CI.js} +2 -2
  8. package/dist/chunks/{chunk-GLGOV3A5.js → chunk-AIXJAVDS.js} +2 -2
  9. package/dist/chunks/{chunk-GIER5WMB.js → chunk-BJOZZ5J6.js} +2 -2
  10. package/dist/chunks/{chunk-GEF2YRBV.js → chunk-CX4XK7WC.js} +2 -2
  11. package/dist/chunks/{chunk-PZ66PUWC.js → chunk-DYCWYHYV.js} +1 -1
  12. package/dist/chunks/{chunk-H72MW7YP.js → chunk-E5M5RAVB.js} +2 -2
  13. package/dist/chunks/{chunk-UMMCVF53.js → chunk-F2MURX2Y.js} +2 -2
  14. package/dist/chunks/{chunk-27VFB3SA.js → chunk-F7SQG6BV.js} +2 -2
  15. package/dist/chunks/{chunk-S2YCFUCA.js → chunk-FCF6FBJP.js} +2 -2
  16. package/dist/chunks/{chunk-6FZAJQ4H.js → chunk-FMLFYM7N.js} +2 -2
  17. package/dist/chunks/{chunk-WWJGCBWH.js → chunk-GDMNF4P3.js} +1 -1
  18. package/dist/chunks/{chunk-ZRFZ5UIB.js → chunk-JBJTXMRJ.js} +2 -2
  19. package/dist/chunks/{chunk-56GFP4UU.js → chunk-L7PDJNJ3.js} +2 -2
  20. package/dist/chunks/{chunk-BQJFFGYP.js → chunk-LVB22NKV.js} +2 -2
  21. package/dist/chunks/{chunk-HWB7XRX2.js → chunk-MJV5G7FG.js} +2 -2
  22. package/dist/chunks/{chunk-5SW3L6J3.js → chunk-MXOGMN4P.js} +2 -2
  23. package/dist/chunks/{chunk-RY7CCWVU.js → chunk-MYRCEQ2R.js} +1 -1
  24. package/dist/chunks/{chunk-ZQSOMEIM.js → chunk-Q32WODL4.js} +2 -2
  25. package/dist/chunks/{chunk-UNP4HBPP.js → chunk-RZBX6VYO.js} +2 -2
  26. package/dist/chunks/{chunk-J72MLFUG.js → chunk-TP4PRPVQ.js} +2 -2
  27. package/dist/chunks/{chunk-RUZATICF.js → chunk-UJM7AJII.js} +1 -1
  28. package/dist/chunks/{chunk-X7K6EF7S.js → chunk-VAWD57ZB.js} +2 -2
  29. package/dist/chunks/{chunk-TEHMTQNB.js → chunk-WBEYJ5W5.js} +2 -2
  30. package/dist/chunks/{chunk-V2KVTAVV.js → chunk-YK2EJU6T.js} +2 -2
  31. package/dist/descriptive.js +2 -2
  32. package/dist/distributions.js +2 -2
  33. package/dist/entries/tests.d.ts +2 -0
  34. package/dist/entries/tests.js +2 -0
  35. package/dist/htest/sampleSize.d.ts +290 -0
  36. package/dist/htest/sampleSize.js +625 -0
  37. package/dist/linalg.js +2 -2
  38. package/dist/mixed.js +2 -2
  39. package/dist/models/competingRisks.d.ts +1 -1
  40. package/dist/models/competingRisks.js +42 -30
  41. package/dist/models/metaAnalysis.d.ts +207 -0
  42. package/dist/models/metaAnalysis.js +696 -0
  43. package/dist/numerics.js +2 -2
  44. package/dist/rstats.js +19 -16
  45. package/dist/special.js +2 -2
  46. package/dist/tests.js +16 -13
  47. package/llms.txt +5 -2
  48. package/package.json +1 -1
@@ -0,0 +1,207 @@
1
+ import type { MatrixInput } from "../linalg/matrix.js";
2
+ import type { DataFrame } from "./modelFrame.js";
3
+ /** Estimator for the between-study variance.
4
+ * @category Meta-analysis
5
+ */
6
+ export type MetaMethod = "EE" | "FE" | "DL" | "HE" | "HS" | "HSk" | "SJ" | "ML" | "REML" | "EB" | "PM";
7
+ /** Inference method for model coefficients.
8
+ * @category Meta-analysis
9
+ */
10
+ export type MetaTest = "z" | "t" | "knha";
11
+ /** Effect-size measure supported by {@link escalc}.
12
+ * @category Meta-analysis
13
+ */
14
+ export type EscalcMeasure = "RR" | "OR" | "RD" | "MD" | "SMD" | "ZCOR";
15
+ /** Options for {@link escalc}.
16
+ * @category Meta-analysis
17
+ */
18
+ export interface EscalcOptions {
19
+ ai?: readonly number[];
20
+ bi?: readonly number[];
21
+ ci?: readonly number[];
22
+ di?: readonly number[];
23
+ m1i?: readonly number[];
24
+ sd1i?: readonly number[];
25
+ n1i?: readonly number[];
26
+ m2i?: readonly number[];
27
+ sd2i?: readonly number[];
28
+ n2i?: readonly number[];
29
+ ri?: readonly number[];
30
+ ni?: readonly number[];
31
+ add?: number;
32
+ to?: "only0" | "all" | "if0all" | "none";
33
+ drop00?: boolean;
34
+ }
35
+ /** Study-level estimates returned by {@link escalc}.
36
+ * @category Meta-analysis
37
+ */
38
+ export interface EscalcResult {
39
+ yi: number[];
40
+ vi: number[];
41
+ measure: EscalcMeasure;
42
+ warnings: string[];
43
+ }
44
+ /** Iteration controls for {@link rma}.
45
+ * @category Meta-analysis
46
+ */
47
+ export interface RmaControl {
48
+ tau2Init?: number;
49
+ threshold?: number;
50
+ maxiter?: number;
51
+ stepadj?: number;
52
+ tol?: number;
53
+ tau2Max?: number;
54
+ }
55
+ /** A moderator matrix with optional column and row names.
56
+ * @category Meta-analysis
57
+ */
58
+ export interface ModeratorMatrix extends Record<string, unknown> {
59
+ rows?: readonly (readonly number[])[];
60
+ columns?: readonly (readonly number[])[];
61
+ dim?: readonly number[];
62
+ rowNames?: readonly string[] | string | null;
63
+ colNames?: readonly string[] | string | null;
64
+ }
65
+ /** Options for {@link rma}.
66
+ * @category Meta-analysis
67
+ */
68
+ export interface RmaOptions {
69
+ method?: MetaMethod;
70
+ mods?: MatrixInput | readonly number[] | string | ModeratorMatrix;
71
+ data?: DataFrame;
72
+ intercept?: boolean;
73
+ test?: MetaTest;
74
+ level?: number;
75
+ control?: RmaControl;
76
+ }
77
+ /** A numeric matrix with its dimensions and dimnames.
78
+ * @category Meta-analysis
79
+ */
80
+ export interface NumericMatrix extends Record<string, unknown> {
81
+ dim: number[];
82
+ rowNames: string | string[] | null;
83
+ colNames: string | string[] | null;
84
+ rows: number[][];
85
+ }
86
+ /** Fitted meta-analysis model returned by {@link rma}.
87
+ * @category Meta-analysis
88
+ */
89
+ export interface RmaResult {
90
+ beta: NumericMatrix;
91
+ se: number | number[];
92
+ zval: number | number[];
93
+ pval: number | number[];
94
+ "ci.lb": number | number[];
95
+ "ci.ub": number | number[];
96
+ tau2: number;
97
+ "se.tau2": number;
98
+ QE: number;
99
+ QEp: number;
100
+ QM: number;
101
+ QMp: number;
102
+ R2: number | null;
103
+ p: number;
104
+ m: number;
105
+ I2: number;
106
+ H2: number;
107
+ k: number;
108
+ yi: number[];
109
+ vi: number[];
110
+ mods: number[][];
111
+ intercept: boolean;
112
+ method: MetaMethod;
113
+ test: MetaTest;
114
+ level: number;
115
+ warnings: string[];
116
+ covariance: number[][];
117
+ tau2Null: number;
118
+ }
119
+ /** Options for {@link confintRma}.
120
+ * @category Meta-analysis
121
+ */
122
+ export interface ConfintRmaOptions {
123
+ type?: "QP" | "PL";
124
+ level?: number;
125
+ }
126
+ /** Options for {@link predictRma}.
127
+ * @category Meta-analysis
128
+ */
129
+ export interface PredictRmaOptions {
130
+ newmods?: MatrixInput | readonly number[];
131
+ predtype?: "default" | "riley";
132
+ level?: number;
133
+ }
134
+ /** Options for {@link regtest}.
135
+ * @category Meta-analysis
136
+ */
137
+ export interface RegtestOptions {
138
+ model?: "rma" | "lm";
139
+ predictor?: "sei" | "vi" | "ninv";
140
+ retFit?: boolean;
141
+ level?: number;
142
+ }
143
+ /**
144
+ * Computes study-level effect sizes and sampling variances. Equivalent to `metafor::escalc()` in R.
145
+ *
146
+ * @param measure One of RR, OR, RD, MD, SMD or ZCOR.
147
+ * @param options Study-level counts, means, standard deviations, sample sizes or correlations.
148
+ * @returns The estimates yi and sampling variances vi.
149
+ * @category Meta-analysis
150
+ */
151
+ export declare function escalc(measure: EscalcMeasure, options: EscalcOptions): EscalcResult;
152
+ /**
153
+ * Fits an equal-effects or random-effects meta-analysis, including meta-regression. Equivalent to `metafor::rma.uni()` in R.
154
+ *
155
+ * @param yi Study effect estimates, or the result of {@link escalc}.
156
+ * @param vi Sampling variances (omitted when yi is an escalc result).
157
+ * @param options Estimator, moderators, inference and iteration controls.
158
+ * @returns Coefficients, heterogeneity statistics, tests and model metadata.
159
+ * @category Meta-analysis
160
+ */
161
+ export declare function rma(yi: readonly number[] | EscalcResult, viOrOptions?: readonly number[] | RmaOptions, maybeOptions?: RmaOptions): RmaResult;
162
+ /** Computes heterogeneity confidence intervals. Equivalent to `metafor::confint.rma()` in R.
163
+ * @category Meta-analysis
164
+ */
165
+ export declare function confintRma(object: RmaResult, options?: ConfintRmaOptions): {
166
+ random: {
167
+ dim: number[];
168
+ rowNames: string[];
169
+ colNames: string[];
170
+ rows: {
171
+ estimate: number;
172
+ "ci.lb": number;
173
+ "ci.ub": number;
174
+ }[];
175
+ };
176
+ digits: Record<string, string>;
177
+ "ci.null": boolean;
178
+ "lb.sign": string;
179
+ "ub.sign": string;
180
+ "tau2.min": string;
181
+ };
182
+ /** Predicts the mean effect and its prediction interval at moderator values. Equivalent to `metafor::predict.rma()` in R.
183
+ * @category Meta-analysis
184
+ */
185
+ export declare function predictRma(object: RmaResult, options?: PredictRmaOptions): {
186
+ pred: number | number[];
187
+ se: number | number[];
188
+ "ci.lb": number | number[];
189
+ "ci.ub": number | number[];
190
+ "pi.lb": number | number[];
191
+ "pi.ub": number | number[];
192
+ };
193
+ /** Tests for funnel-plot asymmetry using a regression model. Equivalent to `metafor::regtest()` in R.
194
+ * @category Meta-analysis
195
+ */
196
+ export declare function regtest(x: readonly number[] | RmaResult, viOrOptions?: readonly number[] | RegtestOptions, maybeOptions?: RegtestOptions): {
197
+ model: string;
198
+ predictor: string;
199
+ zval: number;
200
+ pval: number;
201
+ dfs: number;
202
+ est: number;
203
+ "ci.lb": number;
204
+ "ci.ub": number;
205
+ warnings: string[];
206
+ fit?: RmaResult;
207
+ };