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
8013
1
null
null
9
1911
I have data that is equivalent to: ``` shopper_1 = ['beer', 'eggs', 'water',...] shopper_2 = ['diapers', 'beer',...] ... ``` I would like to do some analysis on this data set to get a correlation matrix that would have an implication similar to: if you bought x, you are likely to buy y. Using python (or perhaps anythi...
How to do a 'beer and diapers' correlation analysis
CC BY-SA 2.5
null
2011-03-08T12:51:04.077
2011-04-11T16:13:02.430
2011-03-09T05:54:19.903
3618
3618
[ "correlation", "econometrics", "python", "cross-correlation" ]
8014
2
null
8000
51
null
What you describe is in fact a "sliding time window" approach and is different to recurrent networks. You can use this technique with any regression algorithm. There is a huge limitation to this approach: events in the inputs can only be correlatd with other inputs/outputs which lie at most t timesteps apart, where t i...
null
CC BY-SA 2.5
null
2011-03-08T12:51:29.233
2011-03-08T15:43:55.373
2011-03-08T15:43:55.373
2860
2860
null
8015
1
null
null
12
3115
I was wondering if anyone could help me with information about kurtosis (i.e. is there any way to transform your data to reduce it?) I have a questionnaire dataset with a large number of cases and variables. For a few of my variables, the data shows pretty high kurtosis values (i.e. a leptokurtic distribution) which is...
Treatment of outliers produced by kurtosis
CC BY-SA 4.0
null
2011-03-08T13:16:00.873
2020-09-27T09:03:05.620
2020-09-27T09:03:05.620
22047
3619
[ "distributions", "assumptions", "discriminant-analysis", "kurtosis" ]
8016
2
null
8010
4
null
The initial problem is: $$\min_{f\in H}\frac{1}{n}\sum_{i=1}^{n}\phi\left(y_{i}f\left(x_{i}\right)\right)+\lambda\left\Vert f\right\Vert _{H}^{2}$$ $$\lambda\geq0$$ $$\phi\left(u\right)=\max\left(1-u,\,0\right)^{2}$$ --- Since, $f=\sum_{i=1}^{n}\alpha_i K_{x_i}$ and we are considering a RKHS, the primal problem is: ...
null
CC BY-SA 2.5
null
2011-03-08T13:19:37.123
2011-03-09T18:19:41.447
2011-03-09T18:19:41.447
1351
1351
null
8017
2
null
7989
5
null
One thing that you must recognise is that the term "noise" is relative not absolute. Thinking about an obvious example (not anything to do with statistics per se), imagine you are at a night club. What is "noise" in here? If you trying to have a conversation with someone, then the music is "noise", and so are the o...
null
CC BY-SA 2.5
null
2011-03-08T13:35:37.283
2011-03-08T13:35:37.283
null
null
2392
null
8018
2
null
8015
10
null
The obvious "common sense" way to resolving your problem is to - Get the conclusion using the full data set. i.e. what results will you declare ignoring intermediate calculations? - Get the conclusion using the data set with said "outliers" removed. i.e. what results will you declare ignoring intermediate calculati...
null
CC BY-SA 2.5
null
2011-03-08T14:11:17.500
2011-03-08T14:11:17.500
null
null
2392
null
8019
1
8023
null
26
34009
Let's say I test how variable `Y` depends on variable `X` under different experimental conditions and obtain the following graph: ![enter image description here](https://i.stack.imgur.com/hpihy.png) The dash lines in the graph above represent linear regression for each data series (experimental setup) and the numbers i...
Averaging correlation values
CC BY-SA 2.5
null
2011-03-08T15:06:44.510
2019-01-11T05:47:12.990
2011-03-08T15:57:47.940
919
1496
[ "regression", "correlation", "mean" ]
8021
1
null
null
12
13977
I have posted a [previous question](https://stats.stackexchange.com/questions/7977/how-to-generate-uniformly-distributed-points-on-the-surface-of-the-3-d-unit-spher), this is related but I think it is better to start another thread. This time, I am wondering how to generate uniformly distributed points inside the 3-d u...
How to generate uniformly distributed points in the 3-d unit ball?
CC BY-SA 3.0
null
2011-03-08T15:34:34.147
2018-06-26T19:35:56.567
2017-04-13T12:44:23.203
-1
3552
[ "random-generation" ]
8022
2
null
8021
16
null
The easiest way is to sample points uniformly in the corresponding hypercube and discard those that do not lie within the sphere. In 3D, this should not happen that often, about 50% of the time. (Volume of the hypercube is 1, volume of the sphere is $\frac{4}{3}\pi r^3 = 0.523...$.)
null
CC BY-SA 2.5
null
2011-03-08T15:52:11.650
2011-03-08T15:52:11.650
null
null
2860
null
8023
2
null
8019
17
null
The simple way is to add a categorical variable $z$ to identify the different experimental conditions and include it in your model along with an "interaction" with $x$; that is, $y \sim z + x\#z$. This conducts all five regressions at once. Its $R^2$ is what you want. To see why averaging individual $R$ values may be...
null
CC BY-SA 3.0
null
2011-03-08T15:57:22.620
2018-03-13T17:55:04.707
2018-03-13T17:55:04.707
919
919
null
8025
1
8026
null
45
63590
Precision is defined as: > p = true positives / (true positives + false positives) What is the value of precision if (true positives + false positives) = 0? Is it just undefined? Same question for recall: > r = true positives / (true positives + false negatives) In this case, what is the value of recall if (true ...
What are correct values for precision and recall when the denominators equal 0?
CC BY-SA 2.5
null
2011-03-08T16:31:51.660
2017-10-02T11:17:57.327
2017-04-13T12:44:40.807
-1
3604
[ "precision-recall" ]
8026
2
null
8025
21
null
The answers to the linked earlier question apply here too. If (true positives + false negatives) = 0 then no positive cases in the input data, so any analysis of this case has no information, and so no conclusion about how positive cases are handled. You want N/A or something similar as the ratio result, avoiding a di...
null
CC BY-SA 2.5
null
2011-03-08T17:02:35.940
2011-03-08T17:02:35.940
null
null
2958
null
8028
1
null
null
0
128
My second question is about Test Statistics. The questions and answers are on this PDF: [http://www.mediafire.com/?b74e633lxdb49rb](http://www.mediafire.com/?b74e633lxdb49rb) I understand that they work out the join density and I know how to calculate this. What I really don’t understand is how they figure out the test...
Test Statistics
CC BY-SA 2.5
null
2011-03-08T18:35:12.617
2011-03-08T19:20:35.300
null
null
null
[ "descriptive-statistics" ]
8029
1
8030
null
3
2370
I am writing a program in C# that requires me to use the Ttest formula. I have to effectively interpret the Excel formula: ``` =TTEST(range1,range2,1,3) ``` I am using the formula given [here](http://www.monarchlab.umn.edu/lab/research/stats/2SampleT.aspx) and have interpreted into code as such: ``` double TStatisti...
How to implement formula for a independent groups t-test in C#?
CC BY-SA 3.0
null
2011-03-08T18:17:59.787
2013-12-18T11:17:36.437
2011-09-23T05:42:13.263
183
3624
[ "t-test" ]
8030
2
null
8029
5
null
There are at least two problems with what you have done. - You have misinterpreted the formula $$t = \frac{\bar{x}_1-\bar{x}_2}{\sqrt{s_1^2 / n_1 + s_2^2 / n_2}}$$ since $s^2$ is already a variance (square of standard deviation) and does not need to be squared again. - You are comparing eggs and omelettes: you ne...
null
CC BY-SA 2.5
null
2011-03-08T19:04:14.603
2011-03-08T19:04:14.603
null
null
2958
null
8032
2
null
8028
2
null
They don't randomly multiply by 1. What they do is split the joint density into the product of two functions: $g(\text{sufficient statistic},\text{parameter})$ and $h(\text{data})$. The advantage of $h()$ is that it removes sometimes complicated parts of the density function which provide no useful information about...
null
CC BY-SA 2.5
null
2011-03-08T19:20:35.300
2011-03-08T19:20:35.300
null
null
2958
null
8033
1
null
null
4
4607
A lecturer wishes to "grade on the curve". The students' marks seem to be normally distributed with mean 70 and standard deviation 8. If the lecturer wants to give 20% A's, what should be the threshold between an A grade and a B grade?
How to find percentiles of a Normal distribution?
CC BY-SA 3.0
null
2011-03-08T20:00:17.407
2011-11-16T20:37:44.703
2011-11-16T20:37:44.703
919
null
[ "self-study", "normal-distribution" ]
8034
2
null
8013
7
null
In addition to the links that were given in comments, here are some further pointers: - Association rules and frequent itemsets - Survey on Frequent Pattern Mining -- look around Table 1, p. 4 About Python, I guess now you have an idea of what you should be looking for, but the [Orange](http://orange.biolab.si/) da...
null
CC BY-SA 3.0
null
2011-03-08T20:59:01.840
2011-04-11T16:13:02.430
2011-04-11T16:13:02.430
930
930
null
8035
2
null
7975
4
null
When you have supporting/causal/helping/right-hand side/exogenous/predictor series, the approach that is preferred is to construct a single equation, multiple-input Transfer Function. One needs to examine possible model residuals for both unspecified/omitted deterministic inputs i.e. do Intervention Detection ala Ruey ...
null
CC BY-SA 2.5
null
2011-03-08T21:06:10.590
2011-03-08T21:06:10.590
null
null
3382
null
8036
1
null
null
3
170
I have gazillion documents (your tax return) that I need to check for correctness, but I don't the manpower nor the will power to read through all of it. Even if I do, I can not guarantee the quality and consistency of the proof reading process. The only thing I can do is to pick a sample collection of document to p...
Proofreading lots of documents based on small sample
CC BY-SA 2.5
null
2011-03-08T21:08:10.473
2011-03-31T12:47:51.767
2011-03-31T07:36:08.540
null
3625
[ "confidence-interval", "quality-control" ]
8037
2
null
7975
22
null
Based upon the comments that you've offered to the responses, you need to be aware of spurious causation. Any variable with a time trend is going to be correlated with another variable that also has a time trend. For example, my weight from birth to age 27 is going to be highly correlated with your weight from birth to...
null
CC BY-SA 2.5
null
2011-03-08T22:02:19.000
2011-03-08T22:02:19.000
null
null
401
null
8040
1
8048
null
11
108357
Is there an easy way to apply the trend line formula from a chart to any given X value in Excel? For example, I want to get the Y value for a given X = $2,006.00. I've already taken the formula and retyped it out be: ``` =-0.000000000008*X^3 - 0.00000001*X^2 + 0.0003*X - 0.0029 ``` I am continually making adjustments ...
Use a trendline formula to get values for any given X with Excel
CC BY-SA 2.5
null
2011-03-08T22:32:45.597
2011-03-11T00:04:11.817
2011-03-11T00:04:11.817
null
3626
[ "regression", "excel" ]
8041
1
null
null
3
1918
I have a bunch of experiments in which I am calculating precision and recall. I want to present a mean precision and recall for these experiments. Should these values be weighted by anything?
Should the mean precision and recall be weighted?
CC BY-SA 2.5
null
2011-03-08T22:40:06.737
2011-09-08T19:46:24.037
null
null
3604
[ "precision-recall" ]
8042
2
null
7996
3
null
EDIT: After some reflection, I modified my answer substantially. The best thing to do would be to try to find a reasonable model for your data (for example, by using multiple linear regression). If you cannot get enough data to do this, I would try the following "non-parametric" approach. Suppose that in your data se...
null
CC BY-SA 2.5
null
2011-03-08T22:49:23.450
2011-03-08T23:40:46.820
2011-03-08T23:40:46.820
3567
3567
null
8043
2
null
7996
5
null
A few comments: - Why did you go with your particular experimental design set-up? For example, fix A+B and vary C. What would you fix A + B at? If you are interesting in determining the effect of A and B, it seems a bit strange that you can fix them at "optimal values". There are standard statistical techniques for sa...
null
CC BY-SA 2.5
null
2011-03-08T23:15:32.683
2011-03-09T12:46:36.880
2020-06-11T14:32:37.003
-1
8
null
8044
1
8050
null
18
2425
I use R. Every day. I think in terms of data.frames, the apply() family of functions, object-oriented programming, vectorization, and ggplot2 geoms/aesthetics. I just started working for an organization that primarily uses SAS. I know there's a book about [learning R for SAS users](http://rads.stackoverflow.com/amzn/cl...
Resources for an R user who must learn SAS
CC BY-SA 2.5
null
2011-03-08T23:27:13.440
2011-03-09T14:29:35.183
null
null
36
[ "r", "sas" ]
8045
5
null
null
0
null
Overview A [distribution](http://en.wikipedia.org/wiki/Distribution) is a mathematical description of probabilities or frequencies. It can be applied to observed frequencies, estimated probabilities or frequencies, and theoretically hypothesized probabilities or frequencies. Distributions can be univariate, describin...
null
CC BY-SA 3.0
null
2011-03-08T23:41:16.543
2013-09-01T23:15:41.880
2013-09-01T23:15:41.880
27581
919
null
8046
4
null
null
0
null
A distribution is a mathematical description of probabilities or frequencies.
null
CC BY-SA 3.0
null
2011-03-08T23:41:16.543
2014-05-22T03:02:41.767
2014-05-22T03:02:41.767
7290
919
null
8048
2
null
8040
16
null
Use `LINEST`, as shown: ![enter image description here](https://i.stack.imgur.com/D7buI.png) The method is to create new columns (C:E here) containing the variables in the fit. Perversely, `LINEST` returns the coefficients in the reverse order, as you can see from the calculation in the "Fit" column. An example predi...
null
CC BY-SA 2.5
null
2011-03-09T00:12:52.290
2011-03-09T00:12:52.290
null
null
919
null
8049
2
null
8040
8
null
Try trend(known_y's, known_x's, new_x's, const). Column A below is X. Column B is X^2 (the cell to the left squared). Column C is X^3 (two cells to the left cubed). The trend() formula is in Cell E24 where the cell references are shown in red. The "known_y's" are in E3:E22 The "known_x's" are in A3:C22 The "new_x's...
null
CC BY-SA 2.5
null
2011-03-09T00:46:15.910
2011-03-09T01:42:27.743
2011-03-09T01:42:27.743
2775
2775
null
8050
2
null
8044
20
null
15 months ago, I started my current job as someone who had been using R exclusively for about 3 years; I had used SAS in my first-ever stats class, loathed it, and never touched it again until I started here. Here's what has been helpful for me, and what hasn't: Helpful: --- - Colleagues' code. This is the single...
null
CC BY-SA 2.5
null
2011-03-09T00:47:43.870
2011-03-09T01:07:51.007
2011-03-09T01:07:51.007
71
71
null
8051
2
null
7990
3
null
EDIT 2: We have to simplify the problem by removing the restriction that $x \ne y$ always in case two. Otherwise correlation issues vastly complicate the answer. Let $|v|$, the 1-norm, denote the sum of the coordinates of the vector. Let $v * w$ denote the coordinate-wise product of the vectors $v$ and $w$. (So the do...
null
CC BY-SA 2.5
null
2011-03-09T00:50:01.100
2011-03-09T10:28:37.683
2011-03-09T10:28:37.683
3567
3567
null
8052
1
8053
null
5
5722
Suppose I'm doing binary classification, and I want to test whether using feature X is significant or not. (For example, I could be building a decision tree, and I want to see whether I should prune feature X or not.) I believe the standard method is to use a chi-square test on the 2x2 table ``` X = 0 X...
2x2 chi-square test vs. binomial proportion statistic
CC BY-SA 2.5
null
2011-03-09T00:54:14.237
2011-06-26T01:43:59.280
null
null
1106
[ "statistical-significance", "chi-squared-test" ]
8053
2
null
8052
3
null
Suppose you have Case 1: > A=200, B=100 C=100, D=200 versus Case 2: > A=200, B=0 C=200, D=200 The B=0 in case 2 means that case 2 provides much stronger evidence than case 1 of a relationship between X and Outcome; but in your test, both cases would be scored the same. The Chi-Square test, informally speaking, no...
null
CC BY-SA 2.5
null
2011-03-09T01:14:39.337
2011-03-09T02:04:47.480
2020-06-11T14:32:37.003
-1
3567
null
8054
2
null
8005
2
null
I'm not sure I understand your question. But if you are working with nontraditional distributions you might want to look at nonparametric methods--in particular, you can use the nonparametric bootstrap to get confidence intervals for "4yrMean - 1yrMean" or whatever statistic you need.
null
CC BY-SA 2.5
null
2011-03-09T02:52:53.240
2011-03-09T02:52:53.240
null
null
3567
null
8055
1
null
null
21
24903
Could someone walk me through an example on how to use DLM Kalman filtering in R on a time series. Say I have a these values (quarterly values with yearly seasonality); how would you use DLM to predict the next values? And BTW, do I have enough historical data (what is the minimum)? ``` 89 2009Q1 82 2009Q2 89 20...
How to use DLM with Kalman filtering for forecasting
CC BY-SA 4.0
null
2011-03-08T18:50:07.840
2018-08-28T16:14:47.997
2018-08-28T16:14:47.997
128677
3645
[ "r", "time-series", "forecasting" ]
8056
2
null
8055
17
null
The paper at [JSS 39-02](http://www.jstatsoft.org/v39/i02) compares 5 different Kalman filtering R packages and gives sample code.
null
CC BY-SA 2.5
null
2011-03-08T21:47:06.360
2011-03-08T21:47:06.360
null
null
4704
null
8057
2
null
8055
8
null
I suggest you read the dlm vignette [http://cran.r-project.org/web/packages/dlm/vignettes/dlm.pdf](http://cran.r-project.org/web/packages/dlm/vignettes/dlm.pdf) especially the chapter 3.3
null
CC BY-SA 2.5
null
2011-03-09T05:56:56.280
2011-03-09T05:56:56.280
null
null
1709
null
8058
1
8060
null
6
11039
I'm building a logistic regression, and two of my variables are categorical with three levels each. (Say one variable is male, female, or unknown, and the other is single, married, or unknown.) How many dummy variables am I supposed to make? Do I make 4 in total (2 for each of the categorical variables, e.g., a male va...
How to choose number of dummy variables when encoding several categorical variables?
CC BY-SA 2.5
null
2011-03-09T06:04:31.097
2017-07-12T11:28:18.607
2017-07-12T11:28:18.607
3277
null
[ "logistic", "categorical-data", "categorical-encoding" ]
8059
1
8076
null
6
950
I'm doing some work on modelling transition matrices, and for this I need a measure of discrepancy or lack of fit: that is, if I have a matrix $T$ and a target matrix $T_0$, I want to be able to calculate how far $T$ is from $T_0$. Would anyone be able to provide pointers on what measure I should be using? I've seen so...
Discrepancy measures for transition matrices
CC BY-SA 2.5
null
2011-03-09T06:14:27.973
2011-03-09T16:06:28.627
2011-03-09T16:06:28.627
223
1569
[ "estimation", "markov-process", "distance-functions" ]
8060
2
null
8058
9
null
You would make k-1 dummy variables for each of your categorical variables. The textbook argument holds; if you were to make k dummies for any of your variables, you would have a collinearity. You can think of the k-1 dummies as being contrasts between the effects of their corresponding levels, and the level whose dummy...
null
CC BY-SA 2.5
null
2011-03-09T06:43:14.660
2011-03-09T06:43:14.660
null
null
1569
null
8063
1
null
null
3
3213
How can I measure linear correlation of non-normally distributed variables? Pearson coefficient is not valid for non-normally distributed data, and Spearman's rho does not capture linear correlation. Thank you
Measuring linear correlation of non-normally distributed variables
CC BY-SA 2.5
null
2011-03-09T09:43:14.043
2012-11-05T17:50:45.337
2011-03-09T09:59:04.997
930
3465
[ "correlation", "measurement" ]
8064
2
null
8063
3
null
Why do you require normality for computing a correlation? How about a simple scatterplot? As long as the data are continuous, ordinary (Pearson) correlation should be fine. All that it is measuring is the strength of the linear relationship between two variables (if indeed there is such a relationship).
null
CC BY-SA 2.5
null
2011-03-09T09:49:24.237
2011-03-09T09:49:24.237
null
null
1945
null
8065
1
8069
null
1
137
I have the following data of 2 diseases from 5 areas. I want to see if there is any relationship between the 2 diseases. Incidence Rates of 2 diseases (cases per million per year) ``` Areas Disease 1 Disease 2 1 4.653 0.751 2 6.910 1.121 3 4.957 0....
Establishing relationship between 2 diseases
CC BY-SA 2.5
null
2011-03-09T10:11:34.210
2011-03-09T12:36:20.820
2011-03-09T12:36:20.820
2956
2956
[ "correlation" ]
8066
2
null
8063
2
null
What @galit said is absolutely right. You can find the linear correlation between any two continuously distributed variables. But perhaps you are thinking of the meaning of such a correlation? Indeed, [Anscombe's quartet](http://en.wikipedia.org/wiki/Anscombe%27s_quartet) shows that while the correlation is defined for...
null
CC BY-SA 2.5
null
2011-03-09T10:11:52.887
2011-03-09T10:11:52.887
null
null
686
null
8067
2
null
8044
6
null
A couple things to add to what @matt said: In addition to SUGI (which is now renamed SAS Global Forum, and will be held this year in Las Vegas) there are numerous local and regional SAS user groups. These are smaller, more intimate, and (usually) a lot cheaper. Some local groups are even free. See [here](http://suppo...
null
CC BY-SA 2.5
null
2011-03-09T10:18:53.657
2011-03-09T10:18:53.657
null
null
686
null
8068
2
null
8059
5
null
Why does one want the measure of discrepancy to be a true metric? There is a huge literature on axiomatic characterizations of I-divergence as measure of distance. It is neither symmetric nor satisfies triangle inequality. I hope by 'transition matrix' you mean 'probability transition matrix'. Never mind, as long as th...
null
CC BY-SA 2.5
null
2011-03-09T10:34:57.833
2011-03-09T10:34:57.833
null
null
3485
null
8069
2
null
8065
3
null
There is no simple answer for how to "establish a relationship between two variables;" indeed, your question is one of the central issues in statistics and research is still going on on how to do this. But some basics: first you will want to plot your data, and then you will want to carry out a linear regression to t...
null
CC BY-SA 2.5
null
2011-03-09T10:51:36.343
2011-03-09T10:56:46.197
2011-03-09T10:56:46.197
3567
3567
null
8070
2
null
7994
2
null
See the papers by Sebastian Mika and co-authors (I think this was the subject of Mika's PhD thesis). The original paper is [here](http://dx.doi.org/10.1109/NNSP.1999.788121) and for free [here](http://ml.cs.tu-berlin.de/publications/MikRaeWesSchMue99.pdf).
null
CC BY-SA 2.5
null
2011-03-09T11:16:18.363
2011-03-09T11:16:18.363
null
null
887
null
8071
1
null
null
156
591713
How do I know when to choose between Spearman's $\rho$ and Pearson's $r$? My variable includes satisfaction and the scores were interpreted using the sum of the scores. However, these scores could also be ranked.
How to choose between Pearson and Spearman correlation?
CC BY-SA 2.5
null
2011-03-09T11:28:52.587
2021-01-30T01:07:10.827
2017-03-02T22:43:24.067
28666
null
[ "correlation", "pearson-r", "spearman-rho" ]
8072
1
8102
null
4
1731
If I want to achieve a margin-of-error of <= 5 % for a representative population sample, how large a sample do I need when: The interviewees are picked from X regions and from Y age groups? That is, how many samples from each age group & region? I know how many people live in each region and how they are distributed in...
Choosing sample size to achieve pre-specified margin-of-error
CC BY-SA 2.5
null
2011-03-09T11:34:14.167
2011-03-09T22:35:21.137
2011-03-09T11:52:29.903
3401
3401
[ "statistical-significance", "sampling" ]
8073
2
null
8071
45
null
This happens often in statistics: there are a variety of methods which could be applied in your situation, and you don't know which one to choose. You should base your decision the pros and cons of the methods under consideration and the specifics of your problem, but even then the decision is usually subjective with ...
null
CC BY-SA 4.0
null
2011-03-09T11:34:52.310
2021-01-30T01:04:45.773
2021-01-30T01:04:45.773
22047
3567
null
8074
2
null
8071
6
null
While agreeing with Charles' answer, I would suggest (on a strictly practical level) that you compute both of the coefficients and look at the differences. In many cases, they will be exactly the same, so you don't need to worry. If however, they are different then you need to look at whether or not you met the assumpt...
null
CC BY-SA 4.0
null
2011-03-09T11:54:45.967
2021-01-30T01:07:10.827
2021-01-30T01:07:10.827
22047
656
null
8075
2
null
8072
3
null
If you weight your measurements (proportion of subpopulation/proportion of subpopulation in sample), your estimates will be unbiased. I assume this is what you meant by "poll results being skewed". If I interpret your question correctly, your goal is the simultaneous estimation of multiple population proportions, wher...
null
CC BY-SA 2.5
null
2011-03-09T12:13:57.863
2011-03-09T12:28:18.687
2020-06-11T14:32:37.003
-1
3567
null
8076
2
null
8059
4
null
As long as your matrix represent conditional probability I think that using a general matrix norm is a bit artificial. Using some sort of geodesic distance on the set of transition matrix might be more relevant but I clearly prefer to come back to probabilities. I assume you want to compare $Q=(Q_{ij})$ and $P=(P_{ij}...
null
CC BY-SA 2.5
null
2011-03-09T13:09:16.753
2011-03-09T13:09:16.753
null
null
223
null
8077
2
null
8071
59
null
Shortest and mostly correct answer is: Pearson benchmarks linear relationship, Spearman benchmarks monotonic relationship (few infinities more general case, but for some power tradeoff). So if you assume/think that the relation is linear (or, as a special case, that those are a two measures of the same thing, so the re...
null
CC BY-SA 2.5
null
2011-03-09T13:16:03.530
2011-03-09T13:16:03.530
null
null
null
null
8078
2
null
8000
10
null
You may also consider simply using a number of transforms of time series for the input data. Just for one example, the inputs could be: - the most recent interval value (7) - the next most recent interval value (6) - the delta between most recent and next most recent (7-6=1) - the third most recent interv...
null
CC BY-SA 2.5
null
2011-03-09T13:57:54.917
2011-03-09T13:57:54.917
null
null
2917
null
8079
1
null
null
0
146
Let say we have only one sample in which we are interested only on one statistics c of this sample. This is usually true in practice when we usually have only one data set. So, most probably the usual estimating method like MLE cant be applied. And let say we want to estimate 2 parameters (i.e. a & b) of a certain dist...
Bootstrap for estimating parameters with only one sample
CC BY-SA 2.5
0
2011-03-09T14:15:07.337
2011-03-09T14:15:07.337
null
null
null
[ "estimation", "bootstrap" ]
8080
2
null
8044
4
null
In addition to Matt Parkers excellent advice (particularly about reading colleagues code), the actual SAS documentation can be surprisingly helpful (once you've figured out the name of what you want): [http://support.sas.com/documentation/](http://support.sas.com/documentation/) And the Global Forum/SUGI proceedings ar...
null
CC BY-SA 2.5
null
2011-03-09T14:29:35.183
2011-03-09T14:29:35.183
null
null
495
null
8082
1
8084
null
3
1496
I am running `ivprobit` in Stata to look at the determinants of enrolment in health insurance (cbhi). I have several exogenous regressors and one endogenous regressor (consumption). I am using wealthindex as an intrumental variable for consumption. However, when I run the `ivprobit` model all my exogenous regressors ap...
Why is Stata automatically converting regressors to instrumental variables in ivprobit model?
CC BY-SA 2.5
null
2011-03-09T15:10:25.447
2011-03-09T16:32:43.060
2011-03-09T16:32:43.060
930
834
[ "stata", "instrumental-variables" ]
8083
1
null
null
1
1723
Revised Version Situation: We have a sample of size $r$. Then, we count how many out of these $r$ to be "success". Let $X=$ the no. of the "successes" and say $X$ follow Poisson dist. Goal: To test whether $X$ is really Poisson using Dispersion Test with test statistics given by $D=\frac{\sum_{i=1}^{n}(X_{i}-\overline...
One-sample-dispersion-test for Poisson parameter
CC BY-SA 2.5
null
2011-03-09T15:12:20.300
2011-03-10T13:31:19.273
2011-03-10T03:59:32.407
null
null
[ "hypothesis-testing", "poisson-distribution", "bootstrap" ]
8084
2
null
8082
6
null
In general all exogenous variables are always included as instruments. Usually instruments are picked for variables which are endogenous, but we can think (it follows from the mathematical derivation of instrumental variable estimation) that we need to choose the instruments for all the variables. Instruments for exoge...
null
CC BY-SA 2.5
null
2011-03-09T15:27:12.967
2011-03-09T15:27:12.967
null
null
2116
null
8086
2
null
8083
4
null
First of all, I don't think you can estimate (over)dispersion from a sample of size 1. Overdispersion means that the sample variance is more than predicted based on other properties of the sample (mean) and properties of the assumed model (for Poisson models, variance = mean). But for a sample of size one, the popula...
null
CC BY-SA 2.5
null
2011-03-09T16:40:43.410
2011-03-09T16:40:43.410
null
null
2975
null
8087
1
44407
null
7
527
I am trying to study hidden conditional random fields but I still have some fundamental questions about those methods. I would be immensely grateful if someone could provide some clarification over the notation used on most papers about the topic. In several papers the most common form of the the HCRF model is given as...
Hidden states in hidden conditional random fields
CC BY-SA 2.5
null
2011-03-09T16:46:25.777
2014-09-02T13:56:03.697
2011-03-09T16:53:24.623
null
1538
[ "machine-learning", "classification", "image-processing" ]
8088
1
null
null
8
1128
I'm working on a project where we observe behaviour on a task (eg. response time) and model this behaviour as a function of several experimentally manipulated variables as well as several observed variable (participant sex, participant IQ, responses on a follow-up questionnaire). I don't have concerns about multicollin...
Assessing multicollinearity of dichotomous predictor variables
CC BY-SA 2.5
null
2011-03-09T17:14:51.320
2011-03-11T17:47:46.867
2011-03-09T18:54:53.200
364
364
[ "regression", "binomial-distribution", "independence", "multicollinearity", "likelihood-ratio" ]
8089
1
8129
null
11
1246
Why doesn't recall take into account true negatives? In experiments where true negatives are just as important as true positives, is their a comparable metric that does take it into account?
Why doesn't recall take into account true negatives?
CC BY-SA 2.5
null
2011-03-09T17:28:58.713
2011-03-10T14:51:01.483
null
null
3604
[ "precision-recall" ]
8090
1
8092
null
8
1158
I have a dataset that's nominally 16-dimensional. I have about 100 samples in one case and about 20,000 in another. Based on various exploratory analyses I've conducted using PCA and heat maps, I'm convinced that the true dimensionality (i.e. the number of dimensions needed to capture most of the "signal") is around ...
How to visualize the true dimensionality of the data?
CC BY-SA 2.5
null
2011-03-09T17:49:53.070
2011-03-10T04:47:44.177
2011-03-09T17:57:03.650
null
1347
[ "data-visualization", "pca", "dimensionality-reduction" ]
8091
2
null
8090
4
null
One way to visualize this would be as follows: - Perform a PCA on the data. - Let $V$ be the vector space spanned by the first two principal component vectors, and let $V^\top$ be the complement. - Decompose each vector $x_i$ in your data set as the sum of an element in $V$ plus a remainder term (which is in $V^\to...
null
CC BY-SA 2.5
null
2011-03-09T18:03:12.767
2011-03-09T18:19:03.830
2011-03-09T18:19:03.830
795
795
null
8092
2
null
8090
6
null
A standard approach would be to do PCA and then show a scree plot, which you ought to be able to get that out of any software you might choose. A little tinkering and you could make it more interpretable for your particular audience if necessary. Sometimes they can be convincing, but often they're ambiguous and there'a...
null
CC BY-SA 2.5
null
2011-03-09T18:11:31.550
2011-03-10T04:47:44.177
2011-03-10T04:47:44.177
26
26
null
8094
2
null
7973
2
null
You just asked for a mathematical shortcut. But I want to take a step back and point out that your approach could give you misleading results. Are you planning this approach? Add additional observations only if you aren't happy with the initial results. Once the results make you happy, presumably because the P value i...
null
CC BY-SA 2.5
null
2011-03-09T18:50:07.717
2011-03-09T18:50:07.717
null
null
25
null
8096
1
null
null
1
6174
How do I establish the +/- in terms of a set of mean ages. My mean age is 27.2. The ages are 20 23 24 43 22 26 18 32 18 41 22 20 26 46 21 27 19 19 39 40 19 39 18 38 24 24 23 30. Thank you.
How to calculate confidence interval of the mean age of a sample?
CC BY-SA 2.5
null
2011-03-09T19:54:06.577
2014-08-25T17:05:57.230
2011-03-10T03:29:13.523
183
null
[ "mean" ]
8097
2
null
8090
0
null
I've done similar using PROC Varclus in SAS. The basic idea is to generate a 4 cluster solution, pick the highest correlated variable with each cluster, and then to demonstrate that this 4 cluster solution explains more of the variation than the two cluster solution. For the 2 cluster solution you could use either Va...
null
CC BY-SA 2.5
null
2011-03-09T20:11:09.467
2011-03-09T20:18:42.687
2011-03-09T20:18:42.687
3489
3489
null
8099
1
8101
null
4
181
I have a linear string of unit length, and I randomly sample two locations a and b from Uniform(0, 1). Then I cut the string at these two locations to get a sub-string. What is the distribution for the size of the sub-string (i.e. |a-b|)? Otherwise, I want to at least know the mean and variance.
Distribution of a random segment on a string
CC BY-SA 2.5
null
2011-03-09T20:39:48.563
2011-03-10T01:29:29.180
null
null
578
[ "distributions", "variance", "mean" ]
8100
2
null
8099
7
null
Here's a snippet of Maple code that shows that the PDF of $\lvert a - b \rvert$ is $2 - 2 t$: ``` with(Statistics): a := RandomVariable(Uniform(0,1)); b := RandomVariable(Uniform(0,1)); PDF(abs(X - Y), t) assuming 0 < t, t < 1; ``` returns $2 - 2 t$. You can see that it's true by computing the probability that $\lvert...
null
CC BY-SA 2.5
null
2011-03-09T21:12:21.203
2011-03-09T21:12:21.203
null
null
2898
null
8101
2
null
8099
8
null
$(a,b)$ constitute one draw from the uniform distribution on the unit square. The region where $|a - b| \gt x$ is a pair of equilateral right triangles, one at $(0,1)$ and the other at $(1,0)$ with side lengths $1-x$; they fit together into a square with area $(1-x)^2$. Thus the CDF of $x = |a-b|$ equals $1 - (1-x)^2$...
null
CC BY-SA 2.5
null
2011-03-09T21:13:30.397
2011-03-10T01:29:29.180
2011-03-10T01:29:29.180
919
919
null
8102
2
null
8072
6
null
Your problem can be solved using the info in the [Wikipedia article for 'Margin of error'](http://en.wikipedia.org/wiki/Margin_of_error#Different_confidence_levels). As it says, the margin of error is largest when the proportion is 0.5. The maximum margin of error at 95% confidence is $m = 0.98 / \sqrt{n}.$ Rearranging...
null
CC BY-SA 2.5
null
2011-03-09T22:35:21.137
2011-03-09T22:35:21.137
null
null
449
null
8103
1
15249
null
2
1473
Asking this for a colleague: They have two groups of people with various characteristics and to address the issue of comparability of outcomes they would like to reference a paper or book that discusses the concept and problems of common support.
What is a good reference that discusses the problem of common support?
CC BY-SA 2.5
0
2011-03-10T01:12:57.133
2011-09-06T13:55:24.433
null
null
1144
[ "distributions", "propensity-scores" ]
8104
1
8108
null
23
13186
## Background One of the most commonly used weak prior on variance is the inverse-gamma with parameters $\alpha =0.001, \beta=0.001$ [(Gelman 2006)](http://www.stat.columbia.edu/~gelman/research/published/taumain.pdf). However, this distribution has a 90%CI of approximately $[3\times10^{19},\infty]$. ``` library(psc...
Why is a $p(\sigma^2)\sim\text{IG(0.001, 0.001)}$ prior on variance considered weak?
CC BY-SA 2.5
null
2011-03-10T03:00:48.210
2013-10-23T16:17:08.657
2011-04-29T00:40:19.050
3911
1381
[ "bayesian", "multilevel-analysis", "prior" ]
8105
2
null
8104
10
null
It's pretty close to flat. Its median is 1.9 E298, almost the largest number one can represent in double precision floating arithmetic. As you point out, the probability it assigns to any interval that isn't really huge is really small. It's hard to get less informative than that!
null
CC BY-SA 2.5
null
2011-03-10T03:15:51.573
2011-03-10T03:15:51.573
null
null
919
null
8106
1
8131
null
44
57218
I am currently reading a [paper](http://www.sciencedirect.com/science?_ob=ArticleURL&_udi=B6VG2-4Y648C8-1&_user=10&_coverDate=11/30/2009&_rdoc=1&_fmt=high&_orig=gateway&_origin=gateway&_sort=d&_docanchor=&view=c&_searchStrId=1672491428&_rerunOrigin=google&_acct=C000050221&_version=1&_urlVersion=0&_userid=10&md5=da95476...
What is the significance of logistic regression coefficients?
CC BY-SA 2.5
null
2011-03-10T03:45:41.767
2018-10-30T16:01:00.207
2020-06-11T14:32:37.003
-1
3652
[ "regression", "logistic", "interpretation" ]
8107
1
8162
null
11
23526
In `R` I can perform a Breusch–Pagan test for heteroscedasticity using the `ncvTest` function of the `car` package. A Breusch–Pagan test is a type of chi squared test. How do I interpret these results: ``` > require(car) > set.seed(100) > x1 = runif(100, -1, 1) > x2 = runif(100, -1, 1) > ncvTest(lm(x1 ~ x2)) Non-const...
How do I interpret the results of a Breusch–Pagan test?
CC BY-SA 2.5
null
2011-03-10T04:09:10.763
2017-11-12T17:21:11.933
2017-11-12T17:21:11.933
11887
179
[ "interpretation", "heteroscedasticity" ]
8108
2
null
8104
42
null
Using the inverse gamma distribution, we get: $$p(\sigma^2|\alpha,\beta) \propto (\sigma^2)^{-\alpha-1} \exp(-\frac{\beta}{\sigma^2})$$ You can see easily that if $\beta \rightarrow 0$ and $\alpha \rightarrow 0$ then the inverse gamma will approach the Jeffreys prior. This distribution is called "uninformative" becaus...
null
CC BY-SA 3.0
null
2011-03-10T04:27:49.310
2013-10-23T16:17:08.657
2013-10-23T16:17:08.657
17230
2392
null
8109
2
null
8106
22
null
The idea here is that in logistic regression, we predict not the actual probability that, say, a southerner votes Republican, but a transformed version of it, the "log odds". Instead of the probability $p$, we deal with $\log p/(1-p)$ and find linear regression coefficients for the log odds. So for example, let's assum...
null
CC BY-SA 2.5
null
2011-03-10T04:30:00.697
2011-03-10T05:05:51.337
2011-03-10T05:05:51.337
98
98
null
8110
2
null
8106
6
null
The coefficients in the logistic regression represent the tendency for a given region/demographic to vote Republican, compared to a reference category. A positive coefficent means that region is more likely to vote Republican, and vice-versa for a negative coefficient; a larger absolute value means a stronger tendency ...
null
CC BY-SA 2.5
null
2011-03-10T05:42:36.100
2011-03-10T05:42:36.100
null
null
1569
null
8111
2
null
8088
3
null
I think you are trying to interpret P(A|B) and P(B|A) as if they should be the same thing. There is no reason for them to be equal, because of the product rule: $$P(AB)=P(A|B)P(B)=P(B|A)P(A)$$ unless $P(B)=P(A)$ then $P(A|B) \neq P(B|A)$ in general. This explains the difference in the "yn" case. Unless you have a "b...
null
CC BY-SA 2.5
null
2011-03-10T05:44:26.280
2011-03-10T05:51:25.883
2011-03-10T05:51:25.883
2392
2392
null
8112
2
null
8063
3
null
In addition to Anscombe's quartet as mentioned by Peter Flom, [here](http://ferrari.dmat.fct.unl.pt/personal/mle/GestaoRisco/Embrechts/risk.pdf) is a very nice paper in the risk-management context illustrating the problems of using linear correlation with non-normally distributed variables. In a nutshell, much of our i...
null
CC BY-SA 2.5
null
2011-03-10T06:01:42.227
2011-03-10T06:07:40.783
2011-03-10T06:07:40.783
1569
1569
null
8113
2
null
8107
5
null
First application of `ncvTest` reports that there is no heteroscedasticity, as it should. The second is not meaningful, since your dependent random variable is random walk. [Breusch-Pagan test](http://en.wikipedia.org/wiki/Breusch%E2%80%93Pagan_test) is assymptotic, so I suspect that it cannot be readily applied for ra...
null
CC BY-SA 2.5
null
2011-03-10T07:53:02.863
2011-03-10T07:53:02.863
null
null
2116
null
8114
1
8120
null
9
8154
According to [this document](http://www.stat.psu.edu/online/courses/stat509/09_interim/09_interim_print.htm): The estimated logarithm of the hazard ratio is approximately normally distributed with variance (1/d1) + (1/d2), where d1 and d2 are the numbers of events in the two treatment groups. Do you have a reference fo...
The estimated logarithm of the hazard ratio is approximately normally distributed
CC BY-SA 4.0
null
2011-03-10T08:07:51.637
2022-07-12T00:52:14.443
2022-07-12T00:52:14.443
11887
3019
[ "survival", "logarithm", "hazard" ]
8115
2
null
7258
1
null
If I understand, you have a classification problem where you observe $(X_1,Y_1),\dots,(X_n,Y_n)$ ($Y_i=1$ correspond to default and $Y_i=0$ no default), and you have much more $Y_i=0$ than $Y_i=1$. You want to take a subsample $S$ of the $(X_i,Y_i)$ that have $Y_i=0$. I am not sure I understand all the points in your ...
null
CC BY-SA 2.5
null
2011-03-10T08:41:57.213
2011-03-10T08:41:57.213
null
null
223
null
8117
1
8118
null
37
12598
Our small team was having a discussion and got stuck. Does anyone know whether Cox regression has an underlying Poisson distribution. We had a debate that maybe Cox regression with constant time at risk will have similarities with Poisson regression with a robust variance. Any ideas?
Does Cox Regression have an underlying Poisson distribution?
CC BY-SA 2.5
null
2011-03-10T09:17:00.893
2013-10-25T22:07:58.210
2013-10-25T22:07:58.210
7515
2961
[ "regression", "poisson-distribution", "cox-model" ]
8118
2
null
8117
37
null
Yes, there is a link between these two regression models. Here is an illustration: Suppose the baseline hazard is constant over time: $h_{0}(t) = \lambda$. In that case, the survival function is $S(t) = \exp\left(-\int_{0}^{t} \lambda du\right) = \exp(-\lambda t)$ and the density function is $f(t) = h(t) S(t) = \lambda...
null
CC BY-SA 2.5
null
2011-03-10T09:34:42.957
2011-03-10T09:34:42.957
null
null
3019
null
8119
1
13846
null
5
1756
I am trying to sample from a Gamma distribution in JAGS ``` gd[i] ~ dgamma(k,r) ``` where k and r are have priors such that they are positive. However I get the following error when I compile the model: ``` Error in node gd[9] Unobserved node inconsistent with unobserved parents at initialization ``` Any ideas? EDI...
Jags error with dgamma
CC BY-SA 2.5
null
2011-03-10T10:09:33.283
2011-11-02T14:22:11.550
2011-03-11T08:03:16.257
1443
1443
[ "bayesian", "markov-chain-montecarlo", "jags" ]
8120
2
null
8114
10
null
The fact that this is approximately normally distributed relies on the central limit theorem (CLT), so will be a better approximation in large samples. The CLT works better for the log of any ratio (risk ratio, odds ratio, hazard ratio..) than for the ratio itself. In suitably large samples, I think this is a good app...
null
CC BY-SA 2.5
null
2011-03-10T10:38:25.433
2011-03-10T10:44:15.927
2011-03-10T10:44:15.927
449
449
null
8121
2
null
8103
1
null
If I understand, you have a classification problem where you observe $(X_1,Y_1),\dots,(X_n,Y_n)$. Denoting by $\mathcal{X}$ the space where $X$ takes values, you assume the existance of $\mathcal{X}_{10}$ the smallest closed subset of $\mathcal{X}$ such that: $\mathcal{X}\setminus \mathcal{X}_{10}$ can be partinione...
null
CC BY-SA 2.5
null
2011-03-10T10:39:31.160
2011-03-10T10:39:31.160
2017-04-13T12:44:24.677
-1
223
null
8123
2
null
8106
6
null
You also asked "how do I know what is significant and what is not." (I assume you mean statistically significant, since practical or substantive significance is another matter.) The asterisks in the table refer to the footnote: some effects are noted as having small p-values. These are obtained using a Wald test of...
null
CC BY-SA 2.5
null
2011-03-10T13:08:08.867
2011-03-10T13:08:08.867
null
null
2669
null
8124
2
null
8083
3
null
Your question contains a "contradiction". The way you have described it, the variable defined as $X$ cannot have a Poisson distribution. I'll explain why. So, you choose a cut-off point, $y_{0}$, and define the original variables $Y_{i}\:(i=1,\dotsc,r)$. You then take a new variable $X_{i}$ and define it as: $$ X...
null
CC BY-SA 2.5
null
2011-03-10T13:31:19.273
2011-03-10T13:31:19.273
null
null
2392
null
8125
2
null
8012
1
null
First let us introduce notation $y_{ki}=t_{k,i,2}-t_{k,i,1}$. Then $\bar\tau=\frac{1}{K}\sum_k\frac{1}{n_k}\sum_iy_{ki}$. The variance then is \begin{align} Var(\bar\tau)&=E(\bar\tau-E\bar\tau)^2=E\left(\frac{1}{K}\sum_k\frac{1}{n_k}\sum_i(y_{ki}-Ey_{ki})\right)^2\\ &=E\frac{1}{K^2}\sum_k\sum_l\frac{1}{n_kn_l}\sum_i\su...
null
CC BY-SA 2.5
null
2011-03-10T13:55:34.027
2011-03-10T13:55:34.027
null
null
2116
null
8126
1
8128
null
9
5693
I want to calculate the hat matrix directly in R for a logit model. According to Long (1997) the hat matrix for logit models is defined as: $$H = VX(X'VX)^{-1} X'V$$ X is the vector of independent variables, and V is a diagonal matrix with $\sqrt{\pi(1-\pi)}$ on the diagonal. I use the `optim` function to maximize the...
How to calculate the hat matrix for logistic regression in R?
CC BY-SA 2.5
null
2011-03-10T14:04:22.007
2011-03-10T14:59:47.350
2011-03-10T14:55:03.557
2704
2704
[ "r", "logistic", "deviance" ]
8127
1
null
null
1
835
I have two variables and 1000 cases. How can I statistically find representative cases from total of 1000, based on statistical properties of both variables and correlation between them. Perhaps something based on T-test and 95% (or 99%) interval but for both variables? I would like to know which statistical method can...
How to make representative sample in dataset with two variables?
CC BY-SA 3.0
null
2011-03-10T14:12:47.033
2013-12-22T08:58:57.147
2013-12-22T08:58:57.147
930
null
[ "distributions", "sample" ]
8128
2
null
8126
14
null
For logistic regression $\pi$ is calculated using formula $$\pi=\frac{1}{1+\exp(-X\beta)}$$ So diagonal values of $V$ can be calculated in the following manner: ``` pi <- 1/(1+exp(-X%*%beta)) v <- sqrt(pi*(1-pi)) ``` Now multiplying by diagonal matrix from left means that each row is multiplied by corresponding elemen...
null
CC BY-SA 2.5
null
2011-03-10T14:20:46.650
2011-03-10T14:59:47.350
2011-03-10T14:59:47.350
2116
2116
null