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
7796
2
null
7774
4
null
Important Note: I've decided to remove the proof I gave originally in this answer. It was longer, more computational, used bigger hammers, and proved a weaker result as compared to the other proof I've given. All around, an inferior approach (in my view). If you're really interested, I suppose you can look at the edits...
null
CC BY-SA 2.5
null
2011-03-02T13:50:29.307
2011-03-07T13:01:34.917
2011-03-07T13:01:34.917
2970
2970
null
7797
1
7798
null
7
1930
This question might be way off base as I am just getting to know vector autoregressive models, but I've tried searching through the usual channels and if this actually is a valid question it might be of help to others that it is here. Should I think in the same way about sample size for a VAR-model as for any other reg...
Is there a method to find what is a good sample size for a VAR-model?
CC BY-SA 2.5
null
2011-03-02T13:58:38.210
2015-01-26T12:05:11.483
null
null
2105
[ "time-series", "multivariate-analysis", "sample-size", "econometrics" ]
7798
2
null
7797
5
null
The usual way of estimating VAR(p) model for $n$-dimensional vector $X_t=(X_{1t},...,X_{nt})$ is using OLS for each equation: \begin{align} X_{it}=\theta_{0i}+\sum_{s=1}^p\sum_{j=1}^n\theta_{sj}X_{j,t-s}+\varepsilon_{it} \end{align} So the answer is yes. For each equation you will need to estimate $np+1$ parameters, so...
null
CC BY-SA 2.5
null
2011-03-02T14:15:22.457
2011-03-02T14:15:22.457
null
null
2116
null
7799
1
7803
null
5
2702
I am a programmer who, in a past life, used the products RS/1, RS/Explore, and RS/Discover in a manufacturing engineer career. Now, years later, I would like to do some multivariate regression on some real-world data (sales data from my wife's store). The point would be to highlight what sales days are truly exceptio...
Tutorial for using R to do multivariate regression?
CC BY-SA 2.5
null
2011-03-02T14:18:10.247
2011-03-02T20:06:24.910
2011-03-02T14:20:51.750
2116
2917
[ "r", "data-visualization", "multivariate-analysis" ]
7800
2
null
7782
5
null
I would probably do the following: 1) Split the data into two roughly equal segments. 2) Perform exploratory analyses on one of these and derive a new model 3) Test the model on the other half of the data. This at least will be something that's not done all that often, which will make it a better fit for publication (s...
null
CC BY-SA 2.5
null
2011-03-02T14:30:59.527
2011-03-02T14:30:59.527
null
null
656
null
7801
2
null
7795
3
null
This will not be a complete answer. All the plotting for `gam` objects is being done with function `plot.gam`. You can look at its code by simply typing ``` > plot.gam ``` in R console. As you will see the code is huge. What I've gleaned from it, that all the plotting is done by gathering relevant information in `pd` ...
null
CC BY-SA 2.5
null
2011-03-02T14:45:37.597
2011-03-02T14:45:37.597
null
null
2116
null
7803
2
null
7799
7
null
This is my favorite one: [Quick-R](http://www.statmethods.net/stats/regression.html)
null
CC BY-SA 2.5
null
2011-03-02T14:49:04.513
2011-03-02T14:49:04.513
null
null
1499
null
7804
2
null
7768
6
null
Instead of assigning special value for non-existent first time runner previous lap time, simply use interaction term for previous lap time with the inverse of first time runner dummy: $$Y_i=\beta_0+\beta_1 FTR_i+\beta_2 (NFTR_i)\times PLT_i+...$$ here - $Y_i$ is your input variable, - $...$ is your other variables...
null
CC BY-SA 2.5
null
2011-03-02T15:01:25.117
2011-03-02T15:01:25.117
null
null
2116
null
7805
1
7812
null
6
166
Let's say you have a jointly gaussian vector random variable $\mathbf{x}$, with mean $\mathbf{M}$ and covariance $\mathbf{S}$. I now transform each scalar element of $\mathbf{x}$ , say $x_j$, with a sigmoid: $$y_j = 1/(1+\exp(-x_j))$$ I am interested in the expectation between two variables $y_j$ and $y_j'$ of the res...
Correlation between two nodes of a single layer MLP for joint-Gaussian input
CC BY-SA 2.5
null
2011-03-02T15:03:56.520
2011-03-02T19:39:10.920
2011-03-02T16:00:10.463
919
3509
[ "machine-learning", "bayesian", "normal-distribution", "data-transformation", "neural-networks" ]
7806
2
null
7795
21
null
Starting with `mgcv` 1.8-6, `plot.gam` invisibly returns the data it uses to generate the plots, i.e. doing `pd <- plot(<some gam() model>)` gives you a list with the plotting data in `pd`. --- ANSWER BELOW FOR `mgcv` <= 1.8-5: I've repeatedly cursed the fact that the plot functions for `mgcv` don't return the stuff...
null
CC BY-SA 3.0
null
2011-03-02T15:15:49.453
2015-04-27T09:54:09.650
2015-04-27T09:54:09.650
1979
1979
null
7807
2
null
7790
5
null
You are calculating the mean of a variable that is 0 if no event and 1 if there is an event. The sum of $N$ such (independent) binomial random variables has a variance $N\times p(1-p)$. The mean has a variance $p(1-p)/N$. We can use a two-sample difference in means test to see whether the difference in proportions betw...
null
CC BY-SA 2.5
null
2011-03-02T15:20:12.543
2011-03-02T17:14:47.650
2011-03-02T17:14:47.650
919
401
null
7808
2
null
7791
5
null
Your data will give partial answers by means of the Hansen-Hurwitz or [Horvitz-Thompson](http://www.math.umt.edu/patterson/549/Horvitz-Thompson.pdf) estimators. The model is this: represent this individual's attendance as a sequence of indicator (0/1) variables $(q_i)$, $i=1, 2, \ldots$. You randomly observe a two-ele...
null
CC BY-SA 2.5
null
2011-03-02T17:06:53.537
2011-03-02T17:06:53.537
null
null
919
null
7809
1
7811
null
4
356
I am trying to find a simple similarity metric that will compare vectors of indeterminate length. These vectors will be populated with values between 1 and 5. In this situation a 1 is closer to a 2 then it is to a 5 etc etc. I am new to this type of math. I naively considered using cosine similarity. However, when I ...
Simple similarity metric
CC BY-SA 2.5
null
2011-03-02T17:30:26.333
2011-03-02T19:01:44.663
null
null
1514
[ "correlation" ]
7810
1
7814
null
11
857
What is the median of the [non-central t distribution](http://en.wikipedia.org/wiki/Noncentral_t-distribution) with non-centrality parameter $\delta \ne 0$? This may be a hopeless question because the CDF appears to be expressed as an infinite sum, and I cannot find any information about the inverse CDF function.
What is the median of a non-central t distribution?
CC BY-SA 2.5
null
2011-03-02T17:47:10.903
2015-09-14T09:27:07.320
null
null
795
[ "distributions", "median", "non-central", "t-distribution" ]
7811
2
null
7809
5
null
You could just use a norm: given vectors $\mathbf{x}$ and $\mathbf{y}$, we define the "2-norm" by $$ ||\mathbf{x} - \mathbf{y}||_2 = \sqrt{\sum_i (x_i - y_i)^2} $$ Similarly we define the"p-norm" by $$ ||\mathbf{x} - \mathbf{y}||_p = \left(\sum_i |x_i - y_i|^p\right)^{1/p} $$ In the limit, as $p \to \infty$, we get...
null
CC BY-SA 2.5
null
2011-03-02T17:52:27.593
2011-03-02T19:01:44.663
2011-03-02T19:01:44.663
795
795
null
7812
2
null
7805
2
null
The question really concerns pairs of normal variates. Let's call them $x_1$ and $x_2$ with means $\mu_i$, standard deviations $\sigma_i$, and correlation $\rho$. Whence their joint pdf is $$\frac{1}{2 \pi \sqrt{1 - \rho^2} \sigma_1 \sigma_2} e^{-\frac{1}{1-\rho^2} \left(\frac{(x_1 - \mu_1)^2}{2 \sigma_1^2} + \frac{...
null
CC BY-SA 2.5
null
2011-03-02T17:59:22.200
2011-03-02T19:39:10.920
2011-03-02T19:39:10.920
919
919
null
7813
1
7877
null
8
12266
I am trying to read up about AdaBoost from [Tibshirani](http://www.stanford.edu/~hastie/local.ftp/Springer/ESLII_print5.pdf) (page 337 onwards), and would appreciate some help in understanding it better. The book says that "For each successive iteration m = 2, 3, . . . , M the observation weights are individually mod...
Adjusting sample weights in AdaBoost
CC BY-SA 2.5
null
2011-03-02T18:06:19.327
2018-01-05T10:16:06.940
2011-03-03T06:12:11.953
-1
3301
[ "machine-learning", "boosting" ]
7814
2
null
7810
11
null
You can approximate it. For example, I made the following nonlinear fits for $\nu$ (degrees of freedom) from 1 through 20 and $\delta$ (noncentrality parameter) from 0 through 5 (in steps of 1/2). Let $$a(\nu) = 0.963158 + \frac{0.051726}{\nu-0.705428} + 0.0112409\log(\nu),$$ $$b(\nu) = -0.0214885+\frac{0.406419}{0.65...
null
CC BY-SA 2.5
null
2011-03-02T19:00:15.790
2011-03-02T19:32:53.217
2011-03-02T19:32:53.217
919
919
null
7815
1
7933
null
116
20750
Many statistical jobs ask for experience with large scale data. What are the sorts of statistical and computational skills that would be need for working with large data sets. For example, how about building regression models given a data set with 10 million samples?
What skills are required to perform large scale statistical analyses?
CC BY-SA 2.5
null
2011-03-02T19:05:46.350
2011-11-29T19:37:05.097
2011-03-06T21:39:42.707
930
3026
[ "regression", "machine-learning", "multivariate-analysis", "large-data" ]
7816
2
null
7815
18
null
Your question should yield some good answers. Here are some starting points. - An ability to work with the tradeoffs between precision and the demands placed on computing power. - Facility with data mining techniques that can be used as preliminary screening tools before conducting regression. E.g., chaid, cart, or...
null
CC BY-SA 2.5
null
2011-03-02T19:27:50.943
2011-03-02T19:27:50.943
null
null
2669
null
7817
1
7867
null
7
272
For a paper, I need an example of a dataset $(x_i,y_i)$ where the residuals are $iid$ (the $x$ do not represent time) with a discontinuity on the effect of $x$ on $y$. - I have already found a dataset in Berger and Pope 2010 but the jump there is not clearly visible - The 'LifeCycleSavings' dataset has been suggeste...
Example of discontinous effect of x on y dataset (for paper)
CC BY-SA 2.5
null
2011-03-02T19:32:52.250
2017-10-26T18:15:15.700
2017-10-26T18:15:15.700
7071
603
[ "dataset", "regression-discontinuity" ]
7818
2
null
7799
5
null
+1 for Quick-R. Another great resource that I (re)turn to regularly is the website of the [UCLA Statistical Consulting Group](http://www.ats.ucla.edu/stat/R/). In particular, it sounds like you might find their [data analysis examples](http://www.ats.ucla.edu/stat/R/dae/default.htm) useful. Many of the cases walk throu...
null
CC BY-SA 2.5
null
2011-03-02T20:06:24.910
2011-03-02T20:06:24.910
null
null
3396
null
7819
2
null
7772
4
null
Might we reformulate the question as: 'I have N M-variate observations which I assume to be generated by N corresponding P-variate latent variables i.e. for each case/row M observed numbers are generated by P unobserved numbers. I have an idea that this mapping is linear with an M x P matrix of coefficients and I want...
null
CC BY-SA 2.5
null
2011-03-02T20:42:51.933
2011-03-02T20:42:51.933
null
null
1739
null
7820
2
null
6455
0
null
... h should be as small as possible to preserve whatever power the LB test may have under the circumstances. As h increases the power drops. The LB test is a dreadfully weak test; you must have a lot of samples; n must be ~> 100 to be meaningful. Unfortunately I have never seen a better test. But perhaps one exists....
null
CC BY-SA 2.5
null
2011-03-02T23:55:45.330
2011-03-02T23:55:45.330
null
null
null
null
7821
2
null
7815
5
null
- Framing the problem in the Map-reduce framework. - The Engineering side of the problem, eg., how much does it hurt to use lower precision for the parameters, or model selection based not only on generalization but storage and computation costs as well.
null
CC BY-SA 3.0
null
2011-03-03T02:00:03.717
2011-11-29T19:37:05.097
2011-11-29T19:37:05.097
2728
2728
null
7824
2
null
7542
0
null
Perhaps you should randomly permute the callers, then, per your example, claim that the first 163 made 30 calls, the next 163 made 31 calls, etc. By 'permutation', I mean sort them in a random order. The simple way to do this is to use your random number generator to assign each caller a number, then sort them by that ...
null
CC BY-SA 2.5
null
2011-03-03T05:39:05.227
2011-03-03T05:39:05.227
null
null
795
null
7825
1
null
null
8
7058
I'm looking at the effect defeat and entrapment inducing conditions have on subjective ratings of defeat and entrapment at three different time points (among other things). However the subjective ratings are not normally distributed. I've done several transformations and the squareroot transformation seems to work bes...
How to do ANOVA on data which is still not normal after transformations?
CC BY-SA 2.5
null
2011-03-03T09:41:24.050
2011-03-03T12:27:03.903
2011-03-03T10:34:07.277
2116
null
[ "nonparametric", "data-transformation" ]
7826
1
null
null
6
1696
I have a dataset about a population in hospital, and what type of infections patients have. Let say the number of patients is 100, 10 of them have pneumonia `(group A)`, 20 of them have urinary tract infection `(group B)`; keep in mind that group A and B can be overlapping, that is a patient suffering from pneumonia ca...
Computing confidence intervals for prevalence for several types of infection
CC BY-SA 2.5
null
2011-03-03T09:52:03.557
2011-08-15T12:48:21.707
2011-03-03T10:08:24.523
930
588
[ "estimation", "confidence-interval", "epidemiology" ]
7827
2
null
7825
3
null
I believe with negatively skewed data, you may have to reflect the data to become positively skewed before applying another data transformation (e.g. log or square root). However, this tends to make interpretation of your results difficult. What is your sample size? Depending on how large it is exactly, parametric test...
null
CC BY-SA 2.5
null
2011-03-03T10:47:45.707
2011-03-03T10:47:45.707
null
null
3309
null
7828
2
null
7825
16
null
It's the residuals that should be normally distributed, not the marginal distribution of your response variable. I would try using transformations, do the ANOVA, and check the residuals. If they look noticeably non-normal regardless of what transformation you use, I would switch to a non-parametric test such as the Fri...
null
CC BY-SA 2.5
null
2011-03-03T11:20:05.713
2011-03-03T11:40:26.200
2011-03-03T11:40:26.200
159
159
null
7829
1
null
null
7
2681
I used [BIRCH](http://en.wikipedia.org/wiki/BIRCH_%28data_clustering%29) and [HAC](http://en.wikipedia.org/wiki/Cluster_analysis#Agglomerative_hierarchical_clustering) to do clustering on my data. I want to now what type of information I can include in reports that my users can generate to get more insights on the clus...
How to generate user-friendly summaries of cluster analysis?
CC BY-SA 2.5
null
2011-03-03T11:26:58.357
2011-03-03T18:01:32.537
2011-03-03T12:29:01.593
930
null
[ "data-visualization", "clustering", "teaching" ]
7830
2
null
7825
2
null
A boxcox transformation (there's one in the MASS package) works as well on negatively as positively skewed data. FYI, you need to enter a formula in that function like y~1 and make sure all of y is positive first (if it's not just add a constant like abs(min(y))). You may have to adjust the lambda range in the functi...
null
CC BY-SA 2.5
null
2011-03-03T12:27:03.903
2011-03-03T12:27:03.903
null
null
601
null
7831
1
null
null
7
899
I am working with the twostep cluster process in SPSS Modeler (Clementine) and trying to get a sense for the distance function used. It is a log-likelihood function (as stated in docs) but I am unsure for even the continuous variables (the function handles continuous and nominal variable) how this is a log likelihood (...
Derivation of distance in TwoStep clustering
CC BY-SA 3.0
null
2011-03-03T12:43:42.567
2017-09-11T11:46:26.327
2017-09-11T11:46:26.327
3277
2040
[ "clustering", "spss", "distance-functions" ]
7832
2
null
7829
2
null
The best method I have found for a non-technical audience is to present a table or plots of the centroids of each cluster along with a description of that cluster. It helps in the business world (not sure your domain) to give a name to each cluster describing it's principle characteristics. Example when clustering cust...
null
CC BY-SA 2.5
null
2011-03-03T12:58:25.523
2011-03-03T12:58:25.523
null
null
2040
null
7833
2
null
7829
3
null
Bubble Charts are a good visual device that you can use to represent your cluster. Pick your 4 most important variables and plot each cluster using the x and y axis, size and color of bubble to represent the 4 factors. If you have many variables you can perform a principal components analysis first to reduce them to ...
null
CC BY-SA 2.5
null
2011-03-03T13:43:30.573
2011-03-03T13:43:30.573
null
null
3489
null
7834
2
null
6835
3
null
I recommend using ARIMA with checks for level shift, trends, and interventions. You can't just try and model the data with the only intent of identifying a trend. It is more complex than just a single focus. Let me explain.... In order to determine if there is a trend, you need to be careful as the trend may be just ...
null
CC BY-SA 2.5
null
2011-03-03T15:26:59.480
2011-03-03T15:32:02.253
2011-03-03T15:32:02.253
3411
3411
null
7835
1
7874
null
5
190
I have a bunch of points that belong to one of population P1, P2, ... Pn AND to class A or B. Within each population I'll be doing classification between A and B, and I want to select features that discriminates the best between A and B. Now, my features are also correlated with population membership, but I don't care ...
Feature selection for classification, controlling for sub-population
CC BY-SA 2.5
null
2011-03-03T15:28:29.620
2011-03-04T10:29:42.123
null
null
1737
[ "classification", "feature-selection", "simpsons-paradox", "confounding" ]
7836
1
7883
null
21
15203
In regression analysis what's the difference between 'data-generation process' and 'model'?
In regression analysis what's the difference between data-generation process and model?
CC BY-SA 2.5
null
2011-03-03T15:29:29.913
2015-11-12T22:32:35.560
2011-03-03T19:40:41.407
null
3525
[ "econometrics" ]
7837
2
null
7836
5
null
The DGP is the true model. The model is what we have tried to, using our best skills, to represent the true state of nature. The DGP is influenced by "noise". Noise can be of many kinds: - One time interventions - Level shifts - Trends - Changes in Seasonality - Changes in Model Parameters - Changes in Varianc...
null
CC BY-SA 2.5
null
2011-03-03T15:36:16.930
2011-03-03T19:40:02.140
2011-03-03T19:40:02.140
null
3411
null
7838
2
null
7835
1
null
A bit more research on Wikipedia indicates that [ANCOVA](http://en.wikipedia.org/wiki/Analysis_of_covariance) may be what I need.
null
CC BY-SA 2.5
null
2011-03-03T15:40:09.830
2011-03-03T15:40:09.830
null
null
1737
null
7839
1
null
null
1
1893
- Using either percent error or percent difference, I want to compare one of my measured values from a set to the mean of the set. By reading the Wikipedia article on percent difference, it's still not quite clear which I should choose. - What if I wanted to compare an instantaneous slope to the slope of a linear reg...
Percent error or percent difference?
CC BY-SA 2.5
null
2011-03-03T15:43:53.747
2011-03-03T22:12:41.800
2011-03-03T19:45:16.987
null
3527
[ "regression", "sampling", "mean" ]
7840
2
null
7835
0
null
I think that linear discriminant analysis is a better option: [http://en.wikipedia.org/wiki/Linear_discriminant_analysis](http://en.wikipedia.org/wiki/Linear_discriminant_analysis) -Ralph Winters
null
CC BY-SA 2.5
null
2011-03-03T15:48:13.713
2011-03-03T15:48:13.713
null
null
3489
null
7844
2
null
7829
9
null
I like a 2D plot that shows the clusters and the actual data points so readers can get an idea of the quality of the clustering. If there are more than two factors, you can put the principle components on the axes, as in my example: ![JMP K-Means 2D Cluster Report](https://i.stack.imgur.com/I4Zt9.png) The equivalent 3D...
null
CC BY-SA 2.5
null
2011-03-03T16:28:00.933
2011-03-03T18:01:32.537
2011-03-03T18:01:32.537
1191
1191
null
7845
1
7847
null
14
6967
Let's say I have two distributions I want to compare in detail, i.e. in a way that makes shape, scale and shift easily visible. One good way to do this is to plot a histogram for each distribution, put them on the same X scale, and stack one underneath the other. When doing this, how should binning be done? Should ...
Best way to put two histograms on same scale?
CC BY-SA 2.5
null
2011-03-03T16:28:11.247
2011-03-08T14:43:57.757
null
null
1347
[ "data-visualization", "histogram", "density-function", "binning" ]
7846
2
null
7784
6
null
The Pearson correlation coefficient measures linear association. Being based on empirical second central moments, it is influenced by extreme values. Therefore: - Evidence of nonlinearity in a scatterplot of actual-vs-predicted values would suggest using an alternative such as the rank correlation (Spearman) coeffic...
null
CC BY-SA 2.5
null
2011-03-03T16:45:19.690
2011-03-03T16:45:19.690
null
null
919
null
7847
2
null
7845
8
null
I think you need to use the same bins. Otherwise the mind plays tricks on you. Normal(0,2) looks more dispersed relative to Normal(0,1) in Image #2 than it does in Image #1. Nothing to do with statistics. It just looks like Normal(0,1) went on a "diet". -Ralph Winters Midpoint and histogram end points can also alter...
null
CC BY-SA 2.5
null
2011-03-03T16:55:22.073
2011-03-08T14:43:57.757
2011-03-08T14:43:57.757
3489
3489
null
7848
2
null
2077
9
null
Logs and reciprocals and other power transformations often yield unexpected results. As for detrending residuals(ie Tukey), this may have some application in some cases but could be dangerous. On the other hand, detecting level shifts and trend changes are systematically available to researchers employing interventi...
null
CC BY-SA 2.5
null
2011-03-03T17:46:47.633
2011-03-03T19:41:27.587
2011-03-03T19:41:27.587
3411
3411
null
7849
2
null
7771
2
null
- Yes. $D = Z/\sqrt{n}$ for the one-sample test. $D = Z/\sqrt{\frac{n_1 n_2}{n_1 + n_2}}$ for the two-sample test. $D$ should also be the "Most Extreme Differences - Absolute" entry in the output graphic (double-click the table shown in the SPSS output viewer). $Z$ might be labeled "Test Statistic," "Kolmogorov-Smirno...
null
CC BY-SA 2.5
null
2011-03-03T18:32:32.497
2011-03-03T18:32:32.497
null
null
3408
null
7850
1
7854
null
6
26730
I working on this data set with marital status and age. I want to plot the percentage of never married man versus each age. Could you please help me to figure out the way how to do it in R? So far I have created two separate arrays with men never marries and ever married. I know how many case of each I have. What i nee...
Calculating proportions by age in R
CC BY-SA 2.5
null
2011-03-03T18:48:35.460
2017-01-30T15:59:33.653
2017-01-30T15:59:33.653
919
3008
[ "r", "data-visualization" ]
7851
2
null
7839
0
null
I do not necessary agree with the Wikipedia article, however, of the two, Percent Error would be a better statistic since you would are essentially treating your average as the "theoretical" value. The article seems to state (though not clearly) that "Percent Difference" involves two experimental values x1 and x2, w...
null
CC BY-SA 2.5
null
2011-03-03T19:07:46.923
2011-03-03T19:07:46.923
null
null
3489
null
7852
2
null
7850
2
null
Probably what you need is `table` or `aggregate`. If you add more details I can give you a more in-depth explanation.
null
CC BY-SA 2.5
null
2011-03-03T19:29:42.647
2011-03-03T19:29:42.647
null
null
582
null
7853
1
7856
null
40
5123
I understand two-tailed hypothesis testing. You have $H_0 : \theta = \theta_0$ (vs. $H_1 = \neg H_0 : \theta \ne \theta_0$). The $p$-value is the probability that $\theta$ generates data at least as extreme as what was observed. I don't understand one-tailed hypothesis testing. Here, $H_0 : \theta\le\theta_0$ (vs. $H_1...
Justification of one-tailed hypothesis testing
CC BY-SA 3.0
null
2011-03-03T19:35:51.870
2014-08-16T19:09:10.283
2014-08-16T19:02:38.267
44269
1720
[ "hypothesis-testing" ]
7854
2
null
7850
10
null
Your approach seems way too complicated to me. Let's start with some data: ``` ## make up some data status <- factor(rbinom(1000, 1, 0.3), labels = c("single", "married")) age <- sample(20:50, 1000, replace = TRUE) df <- data.frame(status, age) head(df) ``` Print the first six cases: ``` > head(df) status age 1 mar...
null
CC BY-SA 2.5
null
2011-03-03T19:44:17.863
2011-03-03T19:44:17.863
null
null
307
null
7855
2
null
7850
5
null
I did something similar recently. There are quite a few ways to aggregate data like this in R, but the `ddply` function from the package `plyr` is my security blanket, and I turn to it for things like this. I'm assuming that you have individual records for each person in your dataset, with age, sex, and marital status...
null
CC BY-SA 3.0
null
2011-03-03T19:57:08.010
2014-07-20T20:40:20.357
2014-07-20T20:40:20.357
71
71
null
7856
2
null
7853
39
null
That's a thoughtful question. Many texts (perhaps for pedagogical reasons) paper over this issue. What's really going on is that $H_0$ is a composite "hypothesis" in your one-sided situation: it's actually a set of hypotheses, not a single one. It is necessary that for every possible hypothesis in $H_0$, the chance ...
null
CC BY-SA 2.5
null
2011-03-03T20:05:43.230
2011-03-03T20:05:43.230
null
null
919
null
7857
2
null
7845
0
null
So it's a question of maintaining the same bin size or maintaining the same number of bins? I can see arguments for both sides. A work-around would be to [standardize](http://en.wikipedia.org/wiki/Standard_score) the values first. Then you could maintain both.
null
CC BY-SA 2.5
null
2011-03-03T20:23:45.953
2011-03-03T20:23:45.953
null
null
1191
null
7858
2
null
7839
2
null
Well, neither of them. And you are trying to bite it from a wrong side. Namely, you need some hypothesis -- to what end you are comparing individual measurements to the mean? This is important, since this determines what method you should use; for instance: - you may have a million normally distributed numbers and 3 o...
null
CC BY-SA 2.5
null
2011-03-03T20:26:17.933
2011-03-03T22:12:41.800
2011-03-03T22:12:41.800
930
null
null
7859
2
null
7835
0
null
If you're only classifying within a population, don't worry about it. Just make sure you present your results in separate tables (or charts or whatever), one for each class. If you're trying to classify observations who's class you do not know, then you need to be more careful. Also, try a randomForest if you know how ...
null
CC BY-SA 2.5
null
2011-03-03T21:06:23.557
2011-03-03T21:06:23.557
null
null
2817
null
7860
1
7862
null
33
12828
Is it possible to visualize the output of Principal Component Analysis in ways that give more insight than just summary tables? Is it possible to do it when the number of observations is large, say ~1e4? And is it possible to do it in R [other environments welcome]?
Visualizing a million, PCA edition
CC BY-SA 2.5
null
2011-03-03T22:59:23.757
2014-09-09T13:58:14.083
2014-09-09T13:58:14.083
28666
30
[ "r", "data-visualization", "pca", "biplot" ]
7861
2
null
7853
6
null
I see the $p$-value as the maximum probability of a type I error. If $\theta \ll \theta_0$, the probability of a type I error rate may be effectively zero, but so be it. When looking at the test from a minimax perspective, an adversary would never draw from deep in the 'interior' of the null hypothesis anyway, and the ...
null
CC BY-SA 3.0
null
2011-03-04T00:15:13.317
2014-08-16T19:07:38.497
2014-08-16T19:07:38.497
44269
795
null
7862
2
null
7860
59
null
The [biplot](http://en.wikipedia.org/wiki/Biplot) is a useful tool for visualizing the results of PCA. It allows you to visualize the principal component scores and directions simultaneously. With 10,000 observations you’ll probably run into a problem with over-plotting. Alpha blending could help there. Here is a PC ...
null
CC BY-SA 3.0
null
2011-03-04T00:28:50.527
2011-10-23T16:46:41.983
2011-10-23T16:46:41.983
1670
1670
null
7863
2
null
7853
2
null
You would use a one-sided hypothesis test if only results in one direction are supportive of the conclusion you are trying to reach. Think of this in terms of the question you are asking. Suppose, for example, you want to see whether obesity leads to increased risk of heart attack. You gather your data, which might con...
null
CC BY-SA 2.5
null
2011-03-04T00:34:19.993
2011-03-04T00:34:19.993
null
null
1569
null
7865
1
null
null
4
834
How large sample size should be for Ljung-Box statistic to achieve a power $\ge 0.5$ when number of lags tested is 1? How does the power fall ( assuming an AR(1) process), with increasing number of lags? The LB test is more than 40 years old, surely someone must have answered these questions by now.
What is the power of the Ljung-Box Test for auto-correlation?
CC BY-SA 2.5
null
2011-03-04T02:44:35.870
2011-03-04T07:43:57.670
2011-03-04T07:28:34.923
2116
3533
[ "time-series", "autocorrelation" ]
7867
2
null
7817
2
null
In economics, this is called "regression discontinuity." For one example, check out David Card & Carlos Dobkin & Nicole Maestas, 2008. "The Impact of Nearly Universal Insurance Coverage on Health Care Utilization: Evidence from Medicare," American Economic Review, American Economic Association, vol. 98(5), pages 2242-5...
null
CC BY-SA 2.5
null
2011-03-04T04:29:51.180
2011-03-04T04:29:51.180
null
null
401
null
7868
1
null
null
3
249
I have a database of some 10000 cell-numbers with mapping of geographical areas they are associated to. I believe the first 5-6 characters in the numbers can point to the geo. area the cell number belongs to. I want to build the rules for such mapping so that geographical area for a new number can be calculated. Can ...
Building a classification rule for geographical mapping of cell phone number
CC BY-SA 2.5
null
2011-03-04T06:28:00.747
2014-08-06T10:33:42.837
2011-03-07T06:01:22.580
1261
1261
[ "classification" ]
7869
1
null
null
4
660
Background: I have the following data (an example): ``` headings = { :heading1 => { :weight => 25, :views => 0, :conversions => 0} :heading2 => { :weight => 25, :views => 0, :conversions => 0} :heading3 => { :weight => 25, :views => 0, :conversions => 0} :heading4 => { :weight => 25...
What statistical technique would be appropriate for optimising the weights?
CC BY-SA 2.5
null
2011-03-04T06:54:53.380
2014-01-02T11:49:27.267
2011-03-04T21:35:45.670
264
3535
[ "optimization", "reinforcement-learning" ]
7870
2
null
7860
4
null
A Wachter plot can help you visualize the eigenvalues of your PCA. It is essentially a Q-Q plot of the eigenvalues against the Marchenko-Pastur distribution. I have an example here:![Wachter plot showing a single dominant eigenvalue](https://i.stack.imgur.com/1gkaA.jpg) There is one dominant eigenvalue which falls outs...
null
CC BY-SA 2.5
null
2011-03-04T06:56:34.357
2011-03-04T06:56:34.357
null
null
795
null
7871
2
null
7865
4
null
A little bit of googling would have answered your question. I am posting this as an answer because [the document](http://lib.stat.cmu.edu/S/Spoetry/Working/ljungbox.pdf) answering the question is number 2 in the google search "power of Ljung-Box test" and this question is number 3. The answer to your question is in gr...
null
CC BY-SA 2.5
null
2011-03-04T07:43:57.670
2011-03-04T07:43:57.670
2017-04-13T12:44:39.283
-1
2116
null
7872
2
null
7860
0
null
You could also use the psych package. This contains a plot.factor method, which will plot the different components against one another in the style of a scatterplot matrix.
null
CC BY-SA 2.5
null
2011-03-04T08:37:56.817
2011-03-04T08:37:56.817
null
null
656
null
7873
1
7926
null
9
382
Today I have got a question about binomial/ logistic regression, its based on an analysis that a group in my department have done and were seeking comments upon. I made up the example below to protect their anonymity, but they were keen to see the responses. Firstly, the analysis began with a simple 1 or 0 binomial re...
Discussing binomial regression and modeling strategies
CC BY-SA 2.5
null
2011-03-04T10:09:32.567
2011-04-29T01:03:49.467
2011-04-29T01:03:49.467
3911
3136
[ "logistic", "modeling", "binomial-distribution", "model-selection" ]
7874
2
null
7835
2
null
Regarding "Calculating one measure across all populations": If you want to find one set of features so that the discriminative measure is good for each population, then calculating an aggregation of the measures (e.g. avg) is certainly a way to go. Depending on what you want to achieve, you can vary how this aggregatio...
null
CC BY-SA 2.5
null
2011-03-04T10:29:42.123
2011-03-04T10:29:42.123
null
null
264
null
7875
2
null
7873
2
null
I think you could explore a nonlinear mixed model; this should allow you to use the data you have effectively. But if relatively few subjects have multiple measures, it won't matter much and may not work well (I think there could be convergence problems). If you are using SAS you could use PROC GLIMMIX; if using R I t...
null
CC BY-SA 2.5
null
2011-03-04T10:55:33.093
2011-03-04T10:55:33.093
null
null
686
null
7876
1
7880
null
15
8904
I have trouble figuring out what the range bars in `plot.stl` exactly mean. I found Gavin's post on this question and read the documentation as well, I understand that they tell the relative magnitude of the decomposed components, but still I am not entirely sure how they work. E.g.: data: tiny bar, no scale seasonal: ...
Interpreting range bars in R's plot.stl?
CC BY-SA 2.5
null
2011-03-04T11:01:08.517
2019-10-08T06:54:18.540
2011-03-04T13:31:52.003
2116
704
[ "r", "time-series" ]
7877
2
null
7813
14
null
mpq has already explained [boosting in plain english](https://stats.stackexchange.com/questions/256/how-boosting-works). A picture may substitute a thousand words ... (stolen from [R. Meir and G. Rätsch. An introduction to boosting and leveraging](http://www.boosting.org/papers/MeiRae03.ps.gz)) ![example adaboost](http...
null
CC BY-SA 2.5
null
2011-03-04T11:46:01.650
2011-03-08T07:41:14.860
2017-04-13T12:44:33.237
-1
264
null
7878
2
null
7869
3
null
So, if I understand correctly, you are trying to arrive at a weighting scheme that maximizes the amount of total conversions. I am assuming that you are going to reset the conversion values for each heading after each weight change. A simple solution then could be something like this: (I'm not familiar with your synta...
null
CC BY-SA 2.5
null
2011-03-04T12:05:12.543
2011-03-04T13:51:43.177
2011-03-04T13:51:43.177
3443
3443
null
7879
2
null
7869
12
null
Your problem is a standard problem in the area of Reinforcement Learning and can be reformulated as [n-armed bandit problem](http://en.wikipedia.org/wiki/N_armed_bandit), where you have to find the best arms to pull to optimize the overall gain. In this case one arm = one header and gain is equivalent to 1 (if conversi...
null
CC BY-SA 3.0
null
2011-03-04T12:05:25.883
2014-01-02T11:49:27.267
2014-01-02T11:49:27.267
264
264
null
7880
2
null
7876
23
null
Here is an example to discuss specifics against: ``` > plot(stl(nottem, "per")) ``` ![Nottingham temperature STL](https://i.stack.imgur.com/hyPtT.png) So on the upper panel, we might consider the bar as 1 unit of variation. The bar on the seasonal panel is only slightly larger than that on the data panel, indicating t...
null
CC BY-SA 2.5
null
2011-03-04T13:03:27.320
2011-03-04T13:03:27.320
null
null
1390
null
7881
2
null
7845
2
null
Another approach would be to plot the different distributions on the same plot and use something like the `alpha` parameter in `ggplot2` to address the overplotting issues. The utility of this method will be dependent on the differences or similarities in your distribution as they will be plotted with the same bins. An...
null
CC BY-SA 2.5
null
2011-03-04T13:32:57.760
2011-03-04T13:32:57.760
null
null
696
null
7882
1
null
null
8
4519
Does anyone know how to construct a confidence interval for predicting a new test value given a trained Relevance Vector Machine (`rvm`) and/or Gaussian Process Regression (`gausspr`) using the [kernlab](http://cran.r-project.org/web/packages/kernlab/index.html) R package? More specifically, how do I get: - The standa...
How to compute prediction error from Relevance Vector Machine and Gaussian Process Regression?
CC BY-SA 2.5
null
2011-03-04T16:32:05.223
2012-03-10T16:40:32.110
2011-03-04T20:02:12.327
930
21360
[ "r", "machine-learning", "bayesian" ]
7883
2
null
7836
18
null
We all have a good sense of what "model" might mean, although its technical definition will vary among disciplines. To compare this to DGP, I began by looking at the top five hits (counting two hits with the same author as one) in Googling "data generation process". - A paper on how the US Air Force actually creates ...
null
CC BY-SA 2.5
null
2011-03-04T16:48:38.367
2011-03-04T16:48:38.367
null
null
919
null
7884
1
7889
null
14
33875
Sometimes I need to get only the first row of a data set grouped by an identifier, as when retrieving age and gender when there are multiple observations per individual. What's a fast (or the fastest) way to do this in R? I used aggregate() below and suspect there are better ways. Before posting this question I searche...
Fast ways in R to get the first row of a data frame grouped by an identifier
CC BY-SA 2.5
null
2011-03-04T17:17:28.997
2015-04-28T08:01:38.093
2011-03-14T15:33:12.630
3432
3432
[ "r", "dataset", "aggregation", "plyr" ]
7885
2
null
7884
4
null
You could try ``` agg <- by(dx, dx$ID, FUN = function(x) x[1, ]) # Which returns a list that you can then convert into a data.frame thusly: do.call(rbind, agg) ``` I have no idea if this will be any faster than `plyr`, though.
null
CC BY-SA 2.5
null
2011-03-04T17:26:41.523
2011-03-04T17:26:41.523
null
null
71
null
7886
2
null
7884
10
null
You can try to use the [data.table](http://cran.r-project.org/web/packages/data.table/index.html) package. For your particular case, the upside is that it's (insanely) fast. The first time I was introduced to it, I was working on data.frame objects with hundreds of thousands of rows. "Normal" `aggregate` or `ddply` met...
null
CC BY-SA 2.5
null
2011-03-04T17:33:51.057
2011-03-10T04:01:35.727
2011-03-10T04:01:35.727
227
227
null
7887
2
null
7884
4
null
Try reshape2 ``` library(reshape2) dx <- melt(dx,id=c('ID','FEM')) dcast(dx,ID+FEM~variable,fun.aggregate=mean) ```
null
CC BY-SA 2.5
null
2011-03-04T17:42:50.517
2011-03-04T17:42:50.517
null
null
2817
null
7888
2
null
7884
10
null
You don't need multiple `merge()` steps, just `aggregate()` both variables of interest: ``` > aggregate(dx[, -1], by = list(ID = dx$ID), head, 1) ID AGE FEM 1 1 30 1 2 2 40 0 3 3 35 1 > system.time(replicate(1000, aggregate(dx[, -1], by = list(ID = dx$ID), + head, 1...
null
CC BY-SA 2.5
null
2011-03-04T17:43:21.490
2011-03-04T20:16:34.900
2011-03-04T20:16:34.900
1390
1390
null
7889
2
null
7884
11
null
Is your ID column really a factor? If it is in fact numeric, I think you can use the `diff` function to your advantage. You could also coerce it to numeric with `as.numeric()`. ``` dx <- data.frame( ID = sort(sample(1:7000, 400000, TRUE)) , AGE = sample(18:65, 400000, TRUE) , FEM = sample(0:1, 400000, TRUE)...
null
CC BY-SA 2.5
null
2011-03-04T17:56:24.290
2011-03-05T14:12:49.310
2011-03-05T14:12:49.310
696
696
null
7890
1
null
null
3
1616
I have data relative to image intensity, which range from 0 to 255. For some models I need to run, I must transform this intensity data to a different scale, which must have a certain mean (for example, 1.5) and a certain maximum (for this example, 2). I have found information on how to convert data to a scale based on...
How to transform data to have a new mean and maximum value?
CC BY-SA 2.5
null
2011-03-04T18:16:51.187
2011-03-04T21:53:32.937
2011-03-04T19:43:24.580
null
3374
[ "data-transformation" ]
7891
1
null
null
3
156
Given a dataset $D$ and a distance measure, I want to split the dataset into two disjoint subsets $X, Y$ of a specified size (say 80% and 20% of the original size), so that the minimum distance of all pairs $(x, y)$ with $x \in X$ and $y \in Y$ is maximized. I found references to max-margin clustering without the size ...
Max-margin clustering with size constraint
CC BY-SA 2.5
null
2011-03-04T18:24:38.790
2011-03-05T00:03:34.177
2011-03-05T00:03:34.177
null
3336
[ "clustering", "max-margin" ]
7892
2
null
5733
2
null
(1) It's the CDF you'll need to generate your simulated time-series. To build it, first histogram your price changes/returns. Take a cumulative sum of bin population starting with your left-most populated bin. Normalize your new function by dividing by the total bin population. What you are left with is a CDF. Her...
null
CC BY-SA 2.5
null
2011-03-04T19:06:54.170
2011-03-04T19:06:54.170
2017-04-13T12:44:52.277
-1
2260
null
7893
2
null
7890
12
null
Let the mean of your sample be $\bar{x}$ and the desired mean be $\bar{y}$. Also, $x_{(n)}$ is your sample maximum and $y_{(n)}$ is the desired maximum. Then, create a transformation of your data $y=ax + b$ such that $\bar{x}$ corresponds to $\bar{y}$ and $x_{(n)}$ corresponds to $y_{(n)}$: $$\begin{align*} a &= \fr...
null
CC BY-SA 2.5
null
2011-03-04T19:09:05.393
2011-03-04T21:53:32.937
2011-03-04T21:53:32.937
919
401
null
7894
1
7904
null
5
889
If my response variable has 2 levels, 0 and 1, I can use a [ROC curve](http://rocr.bioinf.mpi-sb.mpg.de/) to assess the accuracy of my predictive model. But what if my response variable has 3 levels, -1, 0, and 1? Is there a way to plot "[ROC surfaces](http://users.dsic.upv.es/grupos/elp/cferri/vus-ecml03-camera-read...
ROC surfaces in R
CC BY-SA 2.5
null
2011-03-04T19:10:07.560
2011-03-04T23:27:51.500
2011-03-04T19:17:36.493
2817
2817
[ "r", "data-visualization", "roc" ]
7896
2
null
4155
2
null
Perhaps your ARIMA model needs to be tempered with identifiable deterministic structure such as "changes in intercept" or changes in trend. These models would then be classified as robust ARIMA models or Transfer FunctionModels. If there is a True Limiting Value then the data might suggest that as it grows towards that...
null
CC BY-SA 2.5
null
2011-03-04T20:38:15.360
2011-03-04T20:38:15.360
null
null
3382
null
7897
1
null
null
10
1319
A newbie question here. I am currently performing a nonparametric regression using the np package in R. I have 7 features and using a brute force approach I identified the best 3. But, soon I will have many more than 7 features! My question is what are the current best methods for feature selection for nonparametric re...
Best methods of feature selection for nonparametric regression
CC BY-SA 2.5
null
2011-03-04T21:17:23.477
2011-03-23T18:01:20.987
2011-03-04T21:25:50.763
null
3550
[ "r", "machine-learning", "nonparametric", "feature-selection" ]
7898
2
null
7890
1
null
Transforming based on maximum/minimums is dangerous because outliers can drastically affect the scaling. For example, if you have an image mostly in the 10-50 range, with a couple of noisy points in the 250 range, you will be adjusting the image based on a questionable maximum, hurting the dynamic range. I think it wo...
null
CC BY-SA 2.5
null
2011-03-04T21:22:36.553
2011-03-04T21:22:36.553
null
null
2965
null
7899
1
7911
null
11
4175
I need to draw a complex graphics for visual data analysis. I have 2 variables and a big number of cases (>1000). For example (number is 100 if to make dispersion less "normal"): ``` x <- rnorm(100,mean=95,sd=50) y <- rnorm(100,mean=35,sd=20) d <- data.frame(x=x,y=y) ``` 1) I need to plot raw data with point size, cor...
Complex regression plot in R
CC BY-SA 2.5
null
2011-03-04T21:25:00.717
2011-03-06T15:50:56.043
2011-03-04T22:51:29.580
3376
3376
[ "r", "data-visualization", "regression" ]
7900
1
7906
null
8
3118
I'm trying to generate random textual data based on regular expressions. I'd like to be able to do this in R, as I know that R does have regex capabilities. Any leads? This question has come up before in forums ([StackOverflow Post 1](https://stackoverflow.com/questions/274011/random-text-generator-based-on-regex), [St...
Generate random strings based on regular expressions in R
CC BY-SA 2.5
null
2011-03-04T22:29:50.427
2018-06-08T06:19:10.153
2017-05-23T12:39:26.523
-1
3551
[ "r", "data-mining", "random-generation", "text-mining" ]
7901
2
null
7899
2
null
For point 1 just use the `cex` parameter on plot to set the point size. For instance ``` x = rnorm(100) plot(x, pch=20, cex=abs(x)) ``` To have multiple graphs in one plot use `par(mfrow=c(numrows, numcols))` to have an evenly spaced layout or `layout` to make more complex ones.
null
CC BY-SA 2.5
null
2011-03-04T22:35:44.150
2011-03-04T22:35:44.150
null
null
582
null
7902
1
null
null
3
1676
I will simplify our problem in this way. Say there are 100,000 cases in total to examine. Due to the time limitation, we randomly selected 2,000 of them. Then we found 1,000 of them are invalid, so we have only 1,000 valid cases left. Finally we categorize these 1,000 valid cases into 2 categories, A and B; they have 3...
How to calculate confidence interval when only a part of the samples are valid?
CC BY-SA 2.5
null
2011-03-04T22:58:38.217
2011-03-05T01:53:21.813
2011-03-04T23:03:13.063
919
3545
[ "confidence-interval", "sampling", "sample-size", "non-response" ]
7903
1
7908
null
26
1983
QUESTION: I have binary data on exam questions (correct/incorrect). Some individuals might have had prior access to a subset of questions and their correct answers. I don’t know who, how many, or which. If there were no cheating, suppose I would model the probability of a correct response for item $i$ as $logit((p_i = ...
Detecting patterns of cheating on a multi-question exam
CC BY-SA 2.5
null
2011-03-04T23:19:54.100
2011-03-15T15:26:35.357
2011-03-15T15:26:35.357
3432
3432
[ "r", "clustering", "classification", "psychometrics" ]
7904
2
null
7894
6
null
Some idea to stuff it into 2D in 3D is a surface defined by true positive rate of each class ([He, Xin, B.D. Gallas, and E.C. Frey. 2009.](http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=5306177)), so I'll go this way. Let's say the `g` variable holds the vote proportions: ``` g<-model$votes; ``` First you need ...
null
CC BY-SA 2.5
null
2011-03-04T23:22:09.147
2011-03-04T23:27:51.500
2011-03-04T23:27:51.500
null
null
null