Id
stringlengths
1
6
PostTypeId
stringclasses
7 values
AcceptedAnswerId
stringlengths
1
6
ParentId
stringlengths
1
6
Score
stringlengths
1
4
ViewCount
stringlengths
1
7
Body
stringlengths
0
38.7k
Title
stringlengths
15
150
ContentLicense
stringclasses
3 values
FavoriteCount
stringclasses
3 values
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
stringlengths
1
6
OwnerUserId
stringlengths
1
6
Tags
list
11473
1
11488
null
6
6275
I'm performing a relatively simple one-way ANOVA as part of a class exercise. I'd like to get pairwise uncorrected p-values out of R, so I can do a sequential FDR test in another package (I realize there are FDR packages in R as well). I've set up my ANOVA as shown below, and it works fine, produces results, but I can'...
Uncorrected pairwise p-values for one-way ANOVA?
CC BY-SA 3.0
null
2011-06-02T10:45:21.923
2015-08-16T21:59:58.573
2011-06-02T15:33:20.037
3601
410
[ "r", "anova", "self-study", "multiple-comparisons" ]
11474
2
null
643
4
null
Playing around with the following code, varying the value of `M` and choosing distributions other than the uniform can be a fun illustration. ``` N <- 10000 M <- 5 meanvals <- replicate(N, expr = {mean(runif(M,min=0, max=1))}) hist(meanvals, breaks=50, prob=TRUE) ```
null
CC BY-SA 3.0
null
2011-06-02T10:45:50.370
2011-06-02T11:08:55.880
2011-06-02T11:08:55.880
930
1806
null
11475
2
null
8148
8
null
Well, clustering techniques are not limited to distance-based methods where we seek groups of statistical units that are unusually close to each other, in a geometrical sense. There're also a range of techniques relying on density (clusters are seen as "regions" in the feature space) or probability distribution. The l...
null
CC BY-SA 3.0
null
2011-06-02T10:51:50.320
2011-06-02T10:51:50.320
null
null
930
null
11477
2
null
11473
7
null
You can use `pairwise.t.test()` with one of the available options for multiple comparison correction in the `p.adjust.method=` argument; see `help(p.adjust)` for more information on the available option for single-step and step-down methods (e.g., `BH` for FDR or `bonf` for Bonferroni). Of note, you can directly give `...
null
CC BY-SA 3.0
null
2011-06-02T11:06:53.443
2011-06-02T11:06:53.443
null
null
930
null
11478
1
null
null
3
1419
Both dependent and independent variables I deal with are nonstationary series that become stationary after differentiating them once. The problem is that I assume that the dependent variable has a certain constant value which does not depend on the explanatory variables' changes and should be estimated as the model's c...
Constant term in time series econometric models built on 1-st differences
CC BY-SA 3.0
null
2011-06-02T11:15:30.280
2011-06-02T16:42:25.207
2011-06-02T12:45:25.813
2116
4837
[ "time-series", "modeling" ]
11479
2
null
11457
2
null
Disclaimer: This is merely a comment but it won't fit as such, so I'll leave it as a CW response. Everything is already available in Frank Harrell's [rms](http://cran.r-project.org/web/packages/rms/index.html) package (which model to choose, how to evaluate its predictive performance or how to validate it, how not to f...
null
CC BY-SA 3.0
null
2011-06-02T11:23:20.110
2011-06-02T11:49:17.280
2011-06-02T11:49:17.280
930
930
null
11480
2
null
11478
1
null
All software I know allows the user to specify whether or not a constant is included in the model. What software are you using ? Do you wish to share data (coded or not) and the model you are trying to estimate and perhaps I caN shed some light on "stuff" ADDITIONAL MATERIAL ADDED ! When Y and X can be rendered station...
null
CC BY-SA 3.0
null
2011-06-02T12:33:12.367
2011-06-02T16:42:25.207
2011-06-02T16:42:25.207
3382
3382
null
11481
1
11518
null
6
1617
I have completed an experiment measuring the magnetic field of a solenoid. The answer I got was $0.0075 \pm 0.0011$T. The uncertainty by the way was generated from Microsoft Excel's Regression under data analysis and is the standard error of the gradient of some graph. The gradient is the magnetic field, B in Tesla. I ...
How to tell the "closeness" of two variables
CC BY-SA 3.0
null
2011-06-02T12:33:21.893
2011-06-03T14:42:39.133
2011-06-03T14:42:39.133
919
4853
[ "hypothesis-testing", "normal-distribution" ]
11482
2
null
11457
8
null
I really appreciate the pointers to my book and papers and R package. Briefly, stepwise regression is invalid as it destroys all statistical properties of the result as well as faring poorly in predictive accuracy. There is no reason to use ROC curves to guide model selection (if model selection is even a good idea),...
null
CC BY-SA 3.0
null
2011-06-02T12:41:01.310
2011-06-02T12:41:01.310
null
null
4253
null
11483
2
null
396
4
null
These are wonderful suggestions. We have assembled a lot of materials [here](http://hbiostat.org/rflow/graphics.html). A group of statisticians in the pharma industry, academia, and FDA have also creating a resource that are useful for clinical trials and related research [here](http://www.ctspedia.org/do/view/CTSped...
null
CC BY-SA 4.0
null
2011-06-02T12:47:17.963
2022-11-21T12:41:13.030
2022-11-21T12:41:13.030
4253
4253
null
11484
2
null
11478
3
null
As @IrishStat said it depends on the model. One way of recovering constant is to use the mean value of the residuals. Note that this method relies strongly on certain assumptions. Here is the illustration. Suppose your model is $$Y_t=\alpha + \beta X_t + \varepsilon_t$$ with $$E(\varepsilon_t|X_t)=0$$ and you estimate ...
null
CC BY-SA 3.0
null
2011-06-02T13:05:09.017
2011-06-02T13:05:09.017
null
null
2116
null
11485
1
11486
null
1
644
Say I have two $n$-vectors $f(t)=(f_1(t), \dots, f_n(t))$ and $f(s)=(f_1(s), \dots, f_n(s))$, both with expected value 0. Let $\operatorname{Cov}(f(t)) = a \Sigma$ and $\operatorname{Cov}(f(s)) = b \Sigma$ with scalar $a,b$. Further assume that the two vectors are not independent and that $Cov(f_i(t), f_j(s)) = c \Sigm...
Expected value of non-standard quadratic form
CC BY-SA 3.0
null
2011-06-02T13:59:29.967
2011-06-02T14:19:12.410
2011-06-02T14:00:56.677
2116
1979
[ "probability", "correlation", "mathematical-statistics", "expected-value" ]
11486
2
null
11485
4
null
The answer is not that hard to get directly (without resorting to references). Denote $\Sigma=(\sigma_{ij})$, $\Omega=(\Sigma_{ij})$. We have $$Ef(t)'\Sigma f(s)=\sum_{i=1}^n\sum_{j=1}^n\sigma_{ij}Ef_i(t)f_j(s)=\sum_{i=1}^n\sum_{j=1}^n\sigma_{ij}c\Sigma_{ij}$$ Then it is a matter of figuring out what that means: $$Ef(t...
null
CC BY-SA 3.0
null
2011-06-02T14:19:12.410
2011-06-02T14:19:12.410
null
null
2116
null
11487
1
11493
null
2
1182
I wanted to solve such a regression problem: $$Y = Xb + e$$ where $X$ is a $m$ by $n$ matrix, resulting in: b = (X'X)-1X'Y as a solution. Since $n$ is quite large (2400), I can't use the conventional methods to calculate the inverse of $X'X$. So I thought about using LU Decomposition using Crout method. In this [link]...
Solving a regression problem
CC BY-SA 3.0
null
2011-06-02T14:35:39.513
2022-12-03T20:30:09.320
2011-06-02T15:07:28.710
2885
2885
[ "regression", "matrix-decomposition", "matrix-inverse" ]
11488
2
null
11473
9
null
For the `multcomp` package, see the help page for `glht`; you want to use the `"Tukey"` option; this does not actually use the Tukey correction, it just sets up all pairwise comparisons. In the example section there's an example that does exactly what you want. This calculates the estimates and se's for each compariso...
null
CC BY-SA 3.0
null
2011-06-02T14:57:17.083
2011-06-02T14:57:17.083
null
null
3601
null
11489
2
null
11370
2
null
Assuming that John's correction to the data is correct, you can use the `ezANOVA` function from the [ez package](http://cran.r-project.org/web/packages/ez/index.html): ``` my_anova = ezANOVA( data = my_data , dv = .(recalled_items) , wid = .(Subject) , within = .(Task) , between = .(Order) ) ``` pr...
null
CC BY-SA 3.0
null
2011-06-02T15:46:52.483
2011-06-02T15:46:52.483
2017-04-13T12:44:39.283
-1
364
null
11490
1
11491
null
7
3550
Does a high LL value imply that the model has a high $R^2$? I'm a very beginner to statistics so please excuse my naivete.
Does high log-likelihood imply high R^2
CC BY-SA 4.0
null
2011-06-02T16:02:58.393
2020-11-05T13:42:48.797
2020-11-05T13:42:48.797
103153
4855
[ "modeling", "maximum-likelihood", "r-squared" ]
11491
2
null
11490
9
null
No, since for linear regression log likelihood is a sum of squared residuals plus some other terms, log likelihood is scale dependent. So for the same model multiplying the regressors by some constant will change log likelihood but R squared will remain the same.
null
CC BY-SA 3.0
null
2011-06-02T16:13:21.030
2011-06-02T16:13:21.030
null
null
2116
null
11492
2
null
11454
7
null
There are power calculation functions specifically for proportions such as `power.prop.test`: ``` > power.prop.test(p1=0.4, p2=0.6, power=0.8) Two-sample comparison of proportions power calculation n = 96.92364 p1 = 0.4 p2 = 0.6 sig.level = 0.05 power = 0....
null
CC BY-SA 3.0
null
2011-06-02T16:27:52.900
2011-06-02T16:27:52.900
null
null
279
null
11493
2
null
11487
5
null
You say that you need to solve an ordinary least squares problem on 2400 variables. There are two assumptions that I think you need to revisit: Assumption 1: that you need to compute the inverse of $X^TX$. Assumption 2: that solving ordinary least squares on 2400 variables requires specialized methods. I'll examine the...
null
CC BY-SA 4.0
null
2011-06-02T16:56:47.763
2022-12-03T20:30:09.320
2022-12-03T20:30:09.320
79696
439
null
11494
1
11589
null
4
7166
I've run a 2-way ANOVA on growth rate data (grams/day) with the factors of year type (good and poor) and site (A and B). Though the data themselves are non-normal and do not have homogeneous variances, the residuals fall pretty nicely along the qq plot, and they are not heteroskedastic. Running the test shows that ther...
Pairwise comparisons after significant interaction results: parametric or non?
CC BY-SA 3.0
null
2011-06-02T17:43:01.070
2011-06-06T02:19:21.593
2011-06-06T02:19:21.593
4238
4238
[ "anova", "post-hoc", "nonparametric" ]
11495
2
null
11368
5
null
Assuming that in constructing the covariance matrix, you are automatically taking care of the symmetry issue, your log-likelihood will be $-\infty$ when $\Sigma$ is not positive definite because of the $\log {\rm det} \ \Sigma$ term in the model right? To prevent a numerical error if ${\rm det} \ \Sigma < 0$ I would pr...
null
CC BY-SA 3.0
null
2011-06-02T17:51:30.647
2011-06-02T19:42:33.137
2011-06-02T19:42:33.137
4856
4856
null
11496
2
null
6071
3
null
If $\sigma^{2} = {\rm var}(\epsilon)$ is known then you can use the SIMEX method (Stefanski and Cook, 1995) to extrapolate backwards to determine the model the effect when $X$ is not measured with error. The basic idea is - - Generate a grid of $\sigma_{1}, ..., \sigma_{k}$ obtained by adding progressively more measu...
null
CC BY-SA 3.0
null
2011-06-02T18:06:41.773
2011-06-02T18:06:41.773
null
null
4856
null
11498
1
null
null
5
1395
I'm fitting a linear model where the response is a function both of time and of static covariates (i.e. ones that are independent of time). The ultimate goal is to identify significant effects of the static covariates. Is this the best general strategy for selecting variables (in R, using the `nlme` package)? Anything ...
Variable selection for time covariate
CC BY-SA 3.0
null
2011-06-02T20:23:19.327
2011-06-03T12:18:18.957
2011-06-02T22:03:57.473
null
4829
[ "r", "regression", "time-series", "model-selection", "linear-model" ]
11499
2
null
10604
5
null
## Specifying the Input Variables' ARIMA Models The ARIMA Procedure uses the results of the first pair(s) of `identify` and `estimate` statements (i.e., the `identify` and `estimate` statements for the input variables) to create models to forecast the values of the input variable(s) (also called exogenous variable(s...
null
CC BY-SA 3.0
null
2011-06-02T21:16:45.563
2011-06-03T07:32:50.997
2017-04-13T12:44:45.783
-1
1583
null
11500
1
11502
null
7
659
The problem I'm trying to solve here is very simple but the available data is very limited. That makes it a hard problem to solve. The available data are as follows: - I have 100 patients and I need to rank order them in terms of how healthy they are. - I only have 5 measurements for each patient. Each of the five re...
Creating an index based on a set of measurements without a target for purpose of rank ordering
CC BY-SA 3.0
null
2011-06-02T21:30:14.260
2011-06-09T04:20:32.917
2011-06-09T04:20:32.917
183
333
[ "scales", "ranking" ]
11501
2
null
11500
0
null
I would just simply sum them up, weighting each factor if necessary.
null
CC BY-SA 3.0
null
2011-06-02T22:07:12.243
2011-06-02T22:07:12.243
null
null
4860
null
11502
2
null
11500
2
null
A simple approach would be to calculate the sum score or the mean. Another approach would not assume that all variables are of equal importance and we could calculate a weighted mean. Let's assume we have the following 10 patients and variables `v1` to `v5`. ``` > set.seed(1) > df <- data.frame(v1 = sample(1:5, 10, rep...
null
CC BY-SA 3.0
null
2011-06-02T22:38:02.897
2011-06-02T22:38:02.897
null
null
307
null
11503
2
null
11252
4
null
Unfortunately you're not going to be able to create the exact solution you're looking for. The company's existing system depends on linear relationships between the factors and the final score, which is a proxy for probability. Your logistic model, on the other hand, depends on S-shaped curves rather than linear rela...
null
CC BY-SA 3.0
null
2011-06-03T00:03:52.680
2011-06-03T00:03:52.680
null
null
2669
null
11504
1
null
null
2
139
In an attempt to improve the results of Bayesian NNT, I transformed the 7 variables that I have into normal scores (subtracted the mean and divided by SD). Then I used a PCA on the transformed variables to generate new 7 PCs. I used these PCs to run the Bayesian NNT and the classification results improved a little bit....
Performing PCA for normal score transformed data
CC BY-SA 3.0
null
2011-06-03T02:41:07.133
2011-06-04T21:56:23.067
2011-06-04T21:56:23.067
null
4861
[ "bayesian", "pca" ]
11505
1
null
null
2
1951
Does anyone have Stata code they could share with me so that I can run a two-part model to look at health care expenditures? The first part of the model will determine whether or not an individual had any visit and the second part will determine how much individuals spent (estimated on the subset of those who had a vis...
How do I run a two-part model of health care expenditures in Stata?
CC BY-SA 3.0
null
2011-06-03T02:47:45.077
2018-08-27T08:40:27.440
2018-08-27T08:40:27.440
11887
834
[ "logistic", "stata" ]
11506
2
null
11458
1
null
denominators are different in the correlation formula and the autocorrelation formula. (moved to answer at moderator's request)
null
CC BY-SA 3.0
null
2011-06-03T04:05:10.890
2011-06-03T04:05:10.890
null
null
3919
null
11507
2
null
11490
3
null
If all your models have normally distributed errors and are fit to exactly the same data, then there is a straightforward, increasing relationship between likelihood and R^2, since they're both ultimately about the sum of squared errors. But in general, no, you can't look at a pair of log likelihood values and assume m...
null
CC BY-SA 3.0
null
2011-06-03T05:52:22.727
2011-06-03T05:52:22.727
null
null
4862
null
11508
1
11529
null
5
1103
What am I supposed to do when I want to interpret significances, although I know that standard errors are biased because of wrong error term assumptions? I know that there is the possibility to use White estimators, weighted OLS. But my prof told me not to do so. Maybe some extra information: 1.) I am analyzing an OLS ...
What to do with p-values when standard errors are obviously biased
CC BY-SA 3.0
null
2011-06-03T07:38:32.973
2013-03-29T10:12:55.007
2012-05-26T04:08:25.197
4856
4496
[ "regression", "statistical-significance", "p-value", "least-squares" ]
11510
1
11511
null
5
230
I have a web-site, and I found the distribution of user number in a day have an obvious pattern. Not only my own site, I see almost all usage distributions of web-site fit model like this. They look like sine wave. I would like to use the model to predict how many total bandwidth I will use if I know the peak of usage....
What's the best formula to fit the distribution of website user number over a day
CC BY-SA 3.0
null
2011-06-03T08:54:38.197
2011-06-03T11:30:22.467
2011-06-03T11:30:22.467
2116
4865
[ "time-series" ]
11511
2
null
11510
5
null
You have time series data and one develops an equation for intra-day usage which may use either an auto-projective ARIMA model or a set of fixed dummies (23 in number) to predict hourly expectations. One has to be concerned with detecting "unusual data" so that your model/parameters reflect the main body of data and no...
null
CC BY-SA 3.0
null
2011-06-03T10:32:18.730
2011-06-03T10:32:18.730
null
null
3382
null
11512
2
null
11498
1
null
Fitting models that include time, time-squared, time-cubed , sines , cosines et all are not very useful in my opinion as they assume deterministic structure that often is inappropriate. Using historical values that are lagged values of the output and possibly covariate series is the approach to take. When constructing ...
null
CC BY-SA 3.0
null
2011-06-03T12:03:32.843
2011-06-03T12:03:32.843
null
null
3382
null
11513
2
null
11436
0
null
I don't know whether yours is a problem of inference. If the problem is of inferring a vector from $\mathbb{R}^n$ under certain constraints(which should define a closed convex set) when a prior guess say $u$ is given then the vector is inferred by minimizing $\ell_2$-distance from $u$ over the constraint set (if the pr...
null
CC BY-SA 4.0
null
2011-06-03T12:06:15.663
2022-09-03T20:02:06.363
2022-09-03T20:02:06.363
79696
3485
null
11514
2
null
11498
3
null
Fully data-driven model selection will result in standard errors and P-values that are too small, confidence intervals that are too narrow, and overstated effects of remaining terms in the model. For time effects I usually model using restricted cubic splines. A detailed case study in the context of generalized least ...
null
CC BY-SA 3.0
null
2011-06-03T12:18:18.957
2011-06-03T12:18:18.957
null
null
4253
null
11515
1
11521
null
-2
944
$A$, $B$, $C$, $D$ are positive integers. $$A \sim Binomial(p_1, A+B)$$ $$A+C \sim Binomial(p_2, A+B+C+D)$$ My variable of interest is $p_1/p_2$ Could one analytically compute a distribution (preferably exact) for this variable? What would be its mean and variance (how to compute it?).
Distribution of a ratio of two proportions
CC BY-SA 3.0
null
2011-06-03T13:03:23.800
2011-06-03T17:11:01.157
2011-06-03T17:11:01.157
4569
4569
[ "distributions", "variance", "binomial-distribution", "proportion" ]
11516
1
11520
null
2
579
I am doing Cox regression models and KM plots for a data set where the end point is death. In addition there is information about whether the death was cancer-specific or not. So I have three categories: - No death, last seen is the date of censor - Death - cancer-specific - Death - other cause What I would like...
Shall I censor or rather remove other causes in cause-specific survival analysis?
CC BY-SA 3.0
null
2011-06-03T14:04:30.007
2011-06-04T10:52:30.077
2011-06-04T10:52:30.077
null
1150
[ "survival", "cox-model" ]
11517
2
null
11500
5
null
Any function $f: \mathbb{R}^5 \to \mathbb{R}$ that is separately increasing in each of its arguments will work. For example, you can select positive parameters $\alpha_i$ and any real parameters $\lambda_i$ and rank the data $(x_1, x_2, x_3, x_4, x_5)$ according to the values of $$\sum_{i=1}^{5} \alpha_i (x_i^{\lambda...
null
CC BY-SA 3.0
null
2011-06-03T14:08:38.533
2011-06-03T14:08:38.533
2017-04-13T12:44:40.883
-1
919
null
11518
2
null
11481
4
null
### Solution When you assume the residuals (vertical deviations in a graph of $n$ data) are independently and identically distributed with some normal distribution of zero mean, the estimate of the slope will have a Student t distribution with $n-2$ degrees of freedom, scaled by the standard error. Because the theo...
null
CC BY-SA 3.0
null
2011-06-03T14:42:22.673
2011-06-03T14:42:22.673
2020-06-11T14:32:37.003
-1
919
null
11519
1
null
null
4
132
I am starting a work on electric vehicle to see how the charging process can impact the local electricity network. I would like to know if there exists public data of driving "habits". Ideally, I would like time series data for bigh fleets of vehicles in a relatively big city. For a given car these data could be a ser...
Searching for car displacement data
CC BY-SA 3.0
null
2011-06-03T14:49:51.200
2011-06-06T06:14:50.127
2011-06-06T06:14:50.127
223
223
[ "dataset", "spatial", "networks", "spatio-temporal" ]
11520
2
null
11516
8
null
Category 3 should be censored, not removed. Removing them would be similar to removing those in category 1 instead of censoring. The fact that those people were alive and did not die from cancer is useful information. You should also look at all cause mortality in addition to the cancer specific. There is a chance t...
null
CC BY-SA 3.0
null
2011-06-03T14:54:58.087
2011-06-03T14:54:58.087
null
null
4505
null
11521
2
null
11515
1
null
It looks like you have a standard 2x2 table and you want to condition on the margins and compare the conditional proportion to the marginal proportion. This is not simple theoretically since they are not going to be independent. Someone has probably solved this problem sometime, probably in a thesis somewhere, but I ...
null
CC BY-SA 3.0
null
2011-06-03T15:09:58.293
2011-06-03T15:09:58.293
null
null
4505
null
11522
1
11525
null
5
3701
I have been running correlations for a set of data and several subsamples. During this analysis I ran into a situation where the $r^2$ for two groups was smaller in each individual group as opposed to when they are grouped together. - Is there any straight forward explanation for how this could happen?
Why are the correlations in two groups less than the correlation when the groups are combined?
CC BY-SA 3.0
null
2011-06-03T15:23:43.543
2023-01-07T04:18:21.403
2011-06-03T15:36:22.373
183
3727
[ "correlation" ]
11523
2
null
11436
6
null
The key here is understanding the "curse of dimensionality" the paper references. From wikipedia: when the number of dimensions is very large, > nearly all of the high-dimensional space is "far away" from the centre, or, to put it another way, the high-dimensional unit space can be said to consist almost entirely of t...
null
CC BY-SA 3.0
null
2011-06-03T15:26:19.360
2011-06-03T15:26:19.360
null
null
4862
null
11524
2
null
11519
1
null
If you're looking for data, try: [http://www.zanran.com](http://www.zanran.com) =========================== Here are some additional links that might help: [http://pubs.its.ucdavis.edu/download_pdf.php?id=1387](http://pubs.its.ucdavis.edu/download_pdf.php?id=1387) [http://www.its.ucdavis.edu/people/faculty/kurani/index...
null
CC BY-SA 3.0
null
2011-06-03T15:30:12.840
2011-06-03T15:30:12.840
null
null
2775
null
11525
2
null
11522
9
null
Here are just a couple of ideas: - Range restriction is one explanation. Check out this simulation; and this explanation. - Correlated group mean differences is another related idea. Say group 1 has a mean two standard deviations higher than group 2 on both X and Y, but that there is no correlation between X and Y ...
null
CC BY-SA 4.0
null
2011-06-03T15:46:31.267
2023-01-07T04:18:21.403
2023-01-07T04:18:21.403
362671
183
null
11526
2
null
11522
5
null
Sounds like [Simpson's Paradox](http://en.wikipedia.org/wiki/Simpson%27s_paradox).
null
CC BY-SA 3.0
null
2011-06-03T16:06:16.500
2011-06-03T16:06:16.500
null
null
2817
null
11527
1
null
null
2
1197
I've collected around 10 numbers of ants from a colony and introduced the same numbers of ants to the same colony (say Colony-1) at their entrance to see their behaviour (whether they accepts or rejects). Again I introduced 10 ants from different colony (say Colony-2, i.e. non-nestmate) to Colony-1 and checked their...
How to perform Fisher exact test in SPSS?
CC BY-SA 3.0
null
2011-06-03T16:32:05.453
2011-06-04T20:50:09.950
2011-06-04T20:50:09.950
930
4868
[ "spss", "contingency-tables" ]
11528
2
null
11505
1
null
See the code from "Modeling Health Care Costs and Use" presentations by Deb, Manning, and Norton. Aviable via Google or [http://urban.hunter.cuny.edu/~deb/](http://urban.hunter.cuny.edu/~deb/)
null
CC BY-SA 3.0
null
2011-06-03T16:47:14.343
2011-06-03T16:47:14.343
null
null
4691
null
11529
2
null
11508
1
null
You can't interpret the $p$-values. The long-tailed errors you're describing often act to underestimate the standard errors, making your $p$-values too small (not to mention that $\hat{\beta}$ isn't normally distributed in finite samples). I suggest a non-parametric bootstrap so you can characterize the sampling distri...
null
CC BY-SA 3.0
null
2011-06-03T16:57:22.990
2012-05-26T04:07:59.580
2012-05-26T04:07:59.580
4856
4856
null
11530
1
11545
null
3
74
I've collected a data set from the literature. These data are largely binomial: they are clutch sizes of a bird that lays only 1 or 2 eggs in most areas, and in some areas will lay 3. However the only information I have compiled are means, standard errors and sample sizes (# nests) from various sites. Some sites have m...
Computing descriptives statistics for sites and locations based on literature search with sites having varying numbers of time points
CC BY-SA 3.0
null
2011-06-03T18:29:57.233
2011-06-04T17:19:25.383
2011-06-04T17:19:25.383
4238
4238
[ "variance", "standard-deviation", "mean", "standard-error" ]
11531
1
null
null
7
3717
I am looking at timeseries data in foreign exchange and bond markets (to test for reversion on extreme moves). Unfortunate "tick" data, namely high frequency data, is prone to many problems, and they obviously can significantly mess with the analysis. I'd like to know which R library can help with the following type of...
High frequency data series cleaning in R
CC BY-SA 3.0
null
2011-06-03T19:02:33.940
2022-01-08T02:26:32.800
2011-06-03T19:07:57.977
4705
4705
[ "r", "finance" ]
11532
1
null
null
4
772
I have a number of regular daily measurements in a MySQL database that I'd like to manipulate using R. When it's returned from RMySQL, it looks like this: ``` > memdata date vsize 1 2011-04-22 3535.178 2 2011-04-23 5680.516 3 2011-04-24 5468.914 4 2011-04-25 4761.044 5 2011-04-26 4403.515 6 2011-04-27...
Importing time series from SQL base into R
CC BY-SA 3.0
null
2011-06-03T19:34:49.813
2011-06-03T23:37:38.850
2011-06-03T20:31:43.463
null
2659
[ "r", "time-series" ]
11533
2
null
11531
7
null
There's a package for that. Check out [RTAQ](http://cran.r-project.org/web/packages/RTAQ/index.html). Small plug: there's a [quantitative finance stack exchange](https://quant.stackexchange.com/) you may be interested in.
null
CC BY-SA 3.0
null
2011-06-03T19:35:01.857
2011-06-03T19:35:01.857
2017-04-13T12:46:23.127
-1
1657
null
11534
2
null
11532
1
null
Unless I missed something, you want to convert your data.frame into a suitable time-indexed series of measurement. In this case, you can use the [zoo](http://cran.r-project.org/web/packages/zoo/index.html) package as follows: ``` > library(zoo) > memdata.ts <- with(memdata, zoo(vsize, date)) > str(memdata.ts) ‘zoo’ ser...
null
CC BY-SA 3.0
null
2011-06-03T19:55:36.677
2011-06-03T19:55:36.677
null
null
930
null
11535
2
null
11532
3
null
Here's a better reference for that kind of stuff: [http://cran.r-project.org/web/packages/zoo/index.html](http://cran.r-project.org/web/packages/zoo/index.html) Take a look at the vignettes. Edit 1 ========================================= To answer chl's question, I would do the following: ``` library(zoo) memdata.zoo...
null
CC BY-SA 3.0
null
2011-06-03T19:57:29.363
2011-06-03T23:37:38.850
2011-06-03T23:37:38.850
2775
2775
null
11536
2
null
11531
4
null
To detect an anomaly, you need a model which provides an expectation. Intervention Detection yields the answer to the question " What is the probability of observing what I observed before I observed it ? I suggest that you focus on shorter time series and use an automatic modeling algorithm that forms an ARIMA model b...
null
CC BY-SA 3.0
null
2011-06-03T20:01:00.717
2011-06-03T20:01:00.717
null
null
3382
null
11537
1
11538
null
3
430
I have the observations $X(n)$, where $X(n)$ is the realization of a binomial random variable with probability of success $p(n)$, and with $Y(n)$ trials. The observations are independent across $n$. I would like to test the null hypothesis H0: $p(1)=(2)=\cdots=p(N)=0.5$. Is there a standard recommended test? An approa...
Tests on binomial distribution
CC BY-SA 3.0
null
2011-06-03T20:54:23.293
2011-06-03T21:41:23.837
2011-06-03T21:17:38.790
null
30
[ "hypothesis-testing", "binomial-distribution", "goodness-of-fit" ]
11538
2
null
11537
4
null
This is a question of testing if several proportions are equal and equal to a specific value. This is quite standard, and you can do this by a likelihood-ratio test or a [$\chi^2$-test](http://en.wikipedia.org/wiki/Pearson%27s_chi-square_test). In R, the $\chi^2$-test can be computed using [prop.test](http://stat.ethz....
null
CC BY-SA 3.0
null
2011-06-03T21:41:23.837
2011-06-03T21:41:23.837
null
null
4376
null
11539
1
11540
null
8
2005
I found a [list of statistical tests along with practical guidance on Wikipedia](http://en.wikipedia.org/wiki/Statistical_hypothesis_testing#Common_test_statistics). Can anyone point me to something similar, but in a textbook form? I'm interested in particular in practical guidance (along the lines of "should have n>3...
Textbook with list of hypothesis tests and practical guidance on use
CC BY-SA 3.0
null
2011-06-03T22:06:18.400
2011-06-04T21:24:33.003
2011-06-04T03:41:33.923
183
511
[ "hypothesis-testing", "references" ]
11540
2
null
11539
7
null
[Statistical Rules of Thumb](http://vanbelle.org/) (Wiley, 2002), by van Belle, has a lot of useful rules of thumb for applied statistics.
null
CC BY-SA 3.0
null
2011-06-03T22:48:52.627
2011-06-03T22:48:52.627
null
null
930
null
11541
1
11542
null
9
22547
Lets say there is population of measurements X, and 50% of those X = 1, and the the other 50% = 0. Therefore, population mean = 0.5 given a random sample of size n, how do you determine the SE of that sample? Or, in layman's terms, if you flip a coin n times, how far can you expect to deviate from 50% heads and 50% ta...
How to calculate SE for a binary measure, given sample size n and known population mean?
CC BY-SA 3.0
null
2011-06-03T23:01:34.050
2011-06-04T10:46:51.123
2011-06-04T10:46:51.123
null
3443
[ "standard-error", "binary-data" ]
11542
2
null
11541
11
null
Each outcome may be thought of a bernoulli trial with success probability $p$. A ${\rm Bernoulli}(p)$ random variable has mean $p$ and variance $p(1-p)$. Therefore the average of $n$ independent ${\rm Bernoulli}(p)$ random variables also has mean $p$ and variance $p(1-p)/n$, which is typically estimate by $\hat{p}(1 - ...
null
CC BY-SA 3.0
null
2011-06-03T23:08:25.943
2011-06-03T23:08:25.943
null
null
4856
null
11543
1
11550
null
3
112
I've taken a few probability classes and now understand how to calculate some statistical measures like mean and confidence intervals. What I don't know is the what, when, and why of using these measures for specific situations. I'm hoping to put together a good collection of each of these measures, what they're used...
How do I tell when and why to use specific statistical measures?
CC BY-SA 3.0
null
2011-06-02T18:28:17.337
2019-01-03T21:36:33.593
2019-01-03T21:36:33.593
11887
4857
[ "descriptive-statistics", "intuition" ]
11544
1
null
null
10
8267
> Is there a standard (or best) method for testing when a given time-series has stabilized? --- ### Some motivation I have a stochastic dynamic system that outputs a value $x_t$ at each time step $t \in \mathbb{N}$. This system has some transient behavior until time step $t^*$ and then stabilizes around some m...
Testing for stability in a time-series
CC BY-SA 3.0
null
2011-06-04T00:37:18.303
2013-10-03T15:56:00.077
2020-06-11T14:32:37.003
-1
4872
[ "time-series", "machine-learning" ]
11545
2
null
11530
3
null
The simplest approach is to use weighted means. Given a set of $n$ experiments that had mean and standard error $(x_i,\sigma_i)$ we can calculate the overall mean and standard error $(x,\sigma)$ is calculated as follows: $\sigma^2 = \frac{1}{(\sum_{i = 1}^n \frac{1}{\sigma_i^2})}$ and $x = \sigma^2 (\sum_{i = 1}^n \fra...
null
CC BY-SA 3.0
null
2011-06-04T01:10:08.930
2011-06-04T01:10:08.930
null
null
4872
null
11546
1
11563
null
2
5118
I have a series of (x1,y1) points. I'm using a 3rd party software tool to which I feed these points. The tool then provides a mechanism for me to get back a series of (x2,y2) points that are on a Gaussian curve that has been fit to the data. I'd like to confirm that the points I'm getting back are correct (because, fr...
Tool to confirm Gaussian fit
CC BY-SA 3.0
null
2011-06-04T02:41:34.177
2016-12-22T15:34:16.767
2011-06-04T21:59:14.813
null
2767
[ "least-squares", "curve-fitting" ]
11547
1
11558
null
3
580
I am facing a difficult challenge, given my very low skills at text mining… Basically, I have a list of approx. 200 individuals described in a plain text file following a simple structure: > N: (name) Y: (year of birth) S: (sibling) N: (name) Y: (year of birth) S: (sibling) [etc.] Here's the catch: - each individ...
Data transposition from 'clustered rows' into columns
CC BY-SA 3.0
null
2011-06-04T02:47:59.060
2011-07-18T02:59:08.477
null
null
3582
[ "text-mining" ]
11548
1
null
null
5
1705
Given the following dataset for a single article on my site: ``` Article 1 2/1/2010 100 2/2/2010 80 2/3/2010 60 Article 2 2/1/2010 20000 2/2/2010 25000 2/3/2010 23000 ``` where column 1 is the date and column 2 is the number of pageviews for an article. What is a basic acceleration calculation that can be done to det...
What is the best way to determine if pageviews are trending upward or downward?
CC BY-SA 3.0
null
2011-06-04T03:44:05.063
2011-06-08T09:01:08.560
2011-06-04T04:25:48.267
183
4875
[ "statistical-significance", "trend" ]
11549
2
null
11539
4
null
In general, I would have a look at statistics books in your domain of application (e.g., whether it is psychology, ecology, medical, sociology, etc.). Such books tend to have less rigour. Instead, such books often try to give useful decision rules to assist researchers where statistics is not the main interest of the r...
null
CC BY-SA 3.0
null
2011-06-04T03:53:02.130
2011-06-04T03:53:02.130
null
null
183
null
11550
2
null
11543
3
null
### General Advice - Start analysing data and reading the analyses of other researchers. This should assist you in mapping statistical techniques onto data analytic problems. - Read some applied statistics textbooks related to a domain that you are interested in. - If you have specific questions (e.g., when would...
null
CC BY-SA 3.0
null
2011-06-04T04:23:06.383
2011-06-04T04:23:06.383
2017-04-13T12:44:28.873
-1
183
null
11551
1
11554
null
38
34616
I want to browse a .rda file (R dataset). I know about the `View(datasetname)` command. The default R.app that comes for Mac does not have a very good browser for data (it opens a window in X11). I like the RStudio data browser that opens with the `View` command. However, it shows only 1000 rows and omits the remaining...
Is there a good browser/viewer to see an R dataset (.rda file)
CC BY-SA 3.0
null
2011-06-04T04:45:39.070
2017-04-10T20:54:37.823
2016-08-10T23:43:59.497
183
4820
[ "r" ]
11552
2
null
11548
4
null
### General thoughts about pageviews I think there is a fair amount of domain specific knowledge that can be brought to bear on page views. From examining my Google Analytics statistics from particular blog posts, I observe the following characteristics: - Large initial spike in pageviews when an article is first p...
null
CC BY-SA 3.0
null
2011-06-04T05:08:00.960
2011-06-08T09:01:08.560
2017-05-23T12:39:26.167
-1
183
null
11553
1
11559
null
11
2937
The classical F-test for subsets of variables in multilinear regression has the form $$ F = \frac{(\mbox{SSE}(R) - \mbox{SSE}(B))/(df_R - df_B)}{\mbox{SSE}(B)/df_B}, $$ where $\mbox{SSE}(R)$ is the sum of squared errors under the 'reduced' model, which nests inside the 'big' model $B$, and $df$ are the degrees of fre...
What is the power of the regression F test?
CC BY-SA 3.0
null
2011-06-04T05:12:33.510
2011-06-06T05:43:34.767
2011-06-06T05:43:34.767
2116
795
[ "regression", "hypothesis-testing", "statistical-power", "non-central", "f-distribution" ]
11554
2
null
11551
22
null
Here are a few basic options, but like you, I can't say that I'm entirely happy with my current system. Avoid using the viewer: - I.e., Use the command line tools to browse the data - head and tail for showing initial and final rows - str for an overview of variable types - dplyr::glimpse() for an overview of varia...
null
CC BY-SA 3.0
null
2011-06-04T05:32:22.973
2016-08-10T12:35:19.470
2016-08-10T12:35:19.470
79643
183
null
11555
2
null
11539
2
null
### Biometry, by Sokal and Rohlf has a fairly comprehensive table with such information on the inside of the front and back covers, but these tables apparently didn't make (perhaps due to placement) into Google's digitized version.
null
CC BY-SA 3.0
null
2011-06-04T05:34:38.423
2011-06-04T05:34:38.423
2020-06-11T14:32:37.003
-1
1381
null
11556
2
null
11435
2
null
For the case $N=3,\;x_i\sim\mathcal{N}(\mu,\sigma),\;i\in\{1,2,3\}$, i calculated a CDF of $P(y\leq\alpha)=\text{exp}\Big(-\frac{1}{2}(3-\alpha)\big(\frac{\mu}{\sigma}\big)^2\Big)\sqrt{\alpha/3}\;,\quad y=\frac{(x_1+x_2+x_3)^2}{x_1^2+x_2^2+x_3^2},\quad 0\leq\alpha\leq N$. The other cases $N\neq 3$ are much harder to so...
null
CC BY-SA 3.0
null
2011-06-04T05:56:11.803
2011-06-04T06:29:01.780
2011-06-04T06:29:01.780
4360
4360
null
11557
1
11566
null
2
370
I am wondering the orthogonal projectors such as Hadamard transform change the statistics of i.i.d. generated data. Consider, i.i.d. generated data $\mathbf{X}$ of length $N$, $$\mathbf{X}_P=\mathbf{P}\mathbf{X}$$ where $\mathbf{P}$ is an orthogonal projector of size $N \times N$ and $\mathbf{X}_P$ is the projected dat...
Do orthogonal projectors change the statistics of i.i.d. generated data?
CC BY-SA 3.0
null
2011-06-04T07:02:14.690
2011-06-04T15:07:10.027
2011-06-04T10:19:08.300
4770
4770
[ "distributions" ]
11558
2
null
11547
3
null
## Load data Assuming `fd.txt` contains the following ``` N: toto Y: 2000 S: tata N: titi Y: 2004 S: tutu N: toto Y: 2000 S: tata2 N: toto Y: 2000 S: tata3 N: tete Y: 2002 S: tyty N: tete Y: 2002 S: tyty2 ``` here is one solution in R: ``` tmp <- scan("fd.txt", what="character") res <- data.frame(matrix(tmp[se...
null
CC BY-SA 3.0
null
2011-06-04T07:33:59.703
2011-06-04T14:16:20.583
2011-06-04T14:16:20.583
930
930
null
11559
2
null
11553
9
null
The noncentrality parameter is $\delta^{2}$, the projection for the restricted model is $P_{r}$, $\beta$ is the vector of true parameters, $X$ is the design matrix for the unrestricted (true) model, $|| x ||$ is the norm: $$ \delta^{2} = \frac{|| X \beta - P_{r} X \beta ||^{2}}{\sigma^{2}} $$ You can read the formula...
null
CC BY-SA 3.0
null
2011-06-04T10:43:08.553
2011-06-05T05:26:24.257
2011-06-05T05:26:24.257
1909
1909
null
11560
2
null
11544
6
null
This short remark is far from complete answer, just some suggestions: - if you have two periods of time where the behaviour is different, by different I mean either differences in model parameters (not relevant in this particular situation), mean or variance or any other expected characteristic of time-series object...
null
CC BY-SA 3.0
null
2011-06-04T12:58:20.283
2011-06-04T12:58:20.283
null
null
2645
null
11562
1
null
null
5
1038
What is a good statistical test to check if there is a bias in judging in a situation that there is one judge that gave extreme scores (high score for one of the contestant and very low scores on the rest of the contestants)? Here is the actual data in the contest: ``` contestant 1 contestant 2 ...
Assessing rater bias where one rater has given one very high rating and the remainder very low ratings
CC BY-SA 3.0
null
2011-06-04T14:38:53.370
2011-06-05T15:40:09.920
2011-06-05T09:59:41.547
183
4880
[ "reliability", "agreement-statistics", "bias" ]
11563
2
null
11546
2
null
Your fitting method uses least squares. To check it, set up four parallel columns in the spreadsheet: - X has the x-values. - Y has the y-values. - Fit computes the Gaussian values (based on the x-values and three parameters). - Residual is the difference between the y-values and the fits. In order to compute th...
null
CC BY-SA 3.0
null
2011-06-04T14:50:58.937
2011-06-04T14:50:58.937
null
null
919
null
11564
2
null
11544
0
null
You might consider testing backward (with a rolling window) for co-integration between `x` and the long term mean. When `x` is flopping around the mean, hopefully the windowed Augmented Dickey Fuller test, or whatever co-integration test you choose, will tell you that the two series are co-integrated. Once you get in...
null
CC BY-SA 3.0
null
2011-06-04T14:54:56.763
2011-06-04T14:54:56.763
null
null
2775
null
11565
1
null
null
9
1050
I have an application for which I need an approximation to the lognormal sum pdf for use as part of a likelihood function. The lognormal sum distribution has no closed form, and there are a bunch of papers in signal processing journals about different approximations. I have been using one of the simplest approximatio...
Approximating lognormal sum pdf (in R)
CC BY-SA 3.0
null
2011-06-04T15:05:16.417
2012-04-27T12:11:31.803
2011-06-04T21:57:35.843
null
4881
[ "r", "lognormal-distribution" ]
11566
2
null
11557
2
null
The simplest non-trivial example I can construct uses an iid 2-vector of Bernoulli variables and the projection matrix {{1,1},{0,0}}. That is, $\mathbf{P}(\mathbf{x_1},\mathbf{x_2})' = \mathbf{x_1+x_2}$. The projected random variable can take on the values 0, 1, and 2 with positive probability (it has a binomial dis...
null
CC BY-SA 3.0
null
2011-06-04T15:07:10.027
2011-06-04T15:07:10.027
null
null
919
null
11567
2
null
11539
0
null
Could this help? > The following table shows general guidelines for choosing a statistical analysis. We emphasize that these are general guidelines and should not be construed as hard and fast rules. From the UCLA Stata/SAS/R tutorial pages. I use a revised version in class.
null
CC BY-SA 3.0
null
2011-06-04T15:32:06.563
2011-06-04T15:32:06.563
null
null
3582
null
11568
1
11599
null
3
544
I have one data sample of non-negative random variable $X$ with unknown distribution and predefined expected value $y$. Is there any test able to check null hypothesis $\mathbb{E}[X]\geq y$ or $\mathbb{E}[X]\leq y$? Actual data samples are gathered in realtime. More specifically, it's an intervals between HTTP-requests...
How to check hypothesis about estimation of random variable with unknown distribution?
CC BY-SA 3.0
null
2011-06-04T17:29:53.320
2011-06-06T17:19:51.677
2011-06-05T11:36:40.143
4883
4883
[ "hypothesis-testing", "expected-value" ]
11569
2
null
11562
1
null
You won't be able to demonstrate bias, but you can try to establish whether the 96.05 is an outlier using Dixon's Test for Outliers. If these judges went on to judge these same contestants on another task/domain, you could test for the replicability of this unusual result for Judge 5 and Contestant 4.
null
CC BY-SA 3.0
null
2011-06-04T17:34:35.490
2011-06-04T17:34:35.490
null
null
2669
null
11570
2
null
11562
2
null
You could measure agreement in ratings across judges with [inter-rater reliability](http://en.wikipedia.org/wiki/Inter-rater_reliability) statistics. This would tell you whether the judging of contestants is consistent across judges. There may be a more sophisticated way of doing this, but I might naively try dropping ...
null
CC BY-SA 3.0
null
2011-06-04T17:45:48.757
2011-06-04T17:45:48.757
null
null
3874
null
11571
2
null
11551
13
null
RStudio (RStudio.org) has a built-in data frame viewer that's pretty good. Luckily it's read-only. RStudio is very easy to install once you've installed a recent version of R. If using Linux first install the r-base package.
null
CC BY-SA 3.0
null
2011-06-04T18:24:55.150
2011-06-04T18:24:55.150
null
null
4253
null
11572
2
null
11551
12
null
Here are some other thoughts (although I am always reluctant to leave Emacs): - Deducer (with JGR) allows to view a data.frame with a combined variable/data view (à la SPSS). - J Fox's Rcmdr also offers edit/viewing facilities, although in an X11 environment. - J Verzani's Poor Man Gui (pmg) only allows for quick pr...
null
CC BY-SA 3.0
null
2011-06-04T19:48:29.887
2011-06-04T19:48:29.887
null
null
930
null
11573
1
null
null
2
411
I have a set of images of same color cars which I have users rate on a scale from 1-5 (integers only) based on how attractive they think the car design is. For each image I have a set of parameters about the cars in question, mostly various ratios of dimensions (say height at middle, width at trunk, curviness of hood, ...
Discrete choice prediction
CC BY-SA 3.0
null
2011-06-04T20:27:53.267
2011-06-07T20:09:17.800
2011-06-04T21:53:09.463
null
4886
[ "logistic", "multivariate-analysis" ]
11574
2
null
11544
5
null
As I read your question "and the fluctuations around the stable point are much smaller that the fluctuations during the transient period " what I get out of it is a request to detect when and if the variance of the errors has changed and if so when ! If that is your objective then you might consider reviewing the work ...
null
CC BY-SA 3.0
null
2011-06-04T20:28:53.903
2011-06-04T20:28:53.903
null
null
3382
null
11575
2
null
11562
0
null
You could think of this as a test of variances. Judge 5's scores will get more weight because the variability of the scores is higher. This test would be for the equality of two variances. It's in most intro stat books, and even in Excel, which provides the following results for judge 5 versus judge 1-4 F-Test Two-Sam...
null
CC BY-SA 3.0
null
2011-06-04T20:39:11.340
2011-06-04T20:39:11.340
null
null
3919
null
11577
2
null
11539
3
null
For a thorough overview of tests, I can recommend the [Handbook of Parametric and Nonparametric Statistics](http://rads.stackoverflow.com/amzn/click/158488133X) by David Sheskin.
null
CC BY-SA 3.0
null
2011-06-04T21:24:33.003
2011-06-04T21:24:33.003
null
null
198
null