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
8239
1
null
null
8
496
I have just discovered, through [this answer](https://stats.stackexchange.com/questions/8232/understanding-chi-squared-distribution/8233#8233), a [nice video resource](http://www.youtube.com/user/khanacademy#grid/user/1328115D3D8A2566) to share with students in introductory statistics courses. The lectures, produced by...
Introductory statistics video courses for social scientists
CC BY-SA 3.0
null
2011-03-13T15:25:27.093
2012-12-10T02:39:58.003
2017-04-13T12:44:33.310
-1
3582
[ "references" ]
8240
1
null
null
7
188
I have N uniform-random points $p_j$ in a box in $E^d$, $a_i \le x_i \le b_i$, and want to estimate the expected distance of the point nearest the origin in $L_q$: $\quad$ nearest( points $p_j$, box $a_i .. b_i$, $q$ ) $\;\equiv\;$ $\min_{j=1..N}$ $\sum_{i=1..d}$ |$p_{ji}|^q$ The box might straddle 0 in some dimension...
Estimate the nearest of N random points in a box in E^d?
CC BY-SA 2.5
null
2011-03-13T16:10:01.597
2011-03-18T13:20:32.560
2011-03-18T13:20:32.560
557
557
[ "central-limit-theorem", "extreme-value" ]
8241
2
null
8240
6
null
First, here are some commonly known facts which will be useful. Suppose i.i.d $X_1, \cdots, X_n$ have the cumulative distribution function $F(X) = P[X \leq x]$, then cumulative distribution function of $\min X_i$ is $G(X) = 1-(1-F(X))^n.$ The expected value of a nonnegative random variable in terms of its cdf is $E[X...
null
CC BY-SA 2.5
null
2011-03-13T16:51:04.557
2011-03-14T02:20:23.793
2011-03-14T02:20:23.793
3567
3567
null
8242
1
8245
null
18
8784
I would like to use R to plot out something like this: ![Something like this](https://i.stack.imgur.com/oY7UO.png) It would seem possible but highly complex to keep track of the coordinates, width, height, etc. Intuitively it would seem best to treat each cell as a new plot and transform the coordinates for each cell. ...
Plotting sparklines in R
CC BY-SA 2.5
null
2011-03-13T17:21:18.183
2016-01-24T15:15:46.383
2011-03-13T20:20:12.920
null
812
[ "r", "data-visualization", "tables" ]
8243
1
null
null
1
3900
I need to find partial derivatives for: $L=\frac{1}{2}\sum_{i=1}^{n} w_{i}^{2}\sigma_{i}^{2} -\lambda \left( \sum_{i=1}^{n} w_{i} \bar{r_{i}} - \bar{r} \right) -\mu \left( \sum_{i=1}^{n} w_{i}-1 \right)$ with 5 variables, I get 5 partial derivatives $\frac{\partial L}{\partial w_{1}}$, $\frac{\partial L}{\partial w_{2}...
Program to compute partial derivatives
CC BY-SA 2.5
null
2011-03-13T17:25:26.993
2011-07-08T20:37:16.110
2011-03-13T20:10:10.260
919
2914
[ "optimization" ]
8245
2
null
8242
22
null
I initially managed to produce something approaching your original picture with some quick and dirty R code (see this [gist](https://gist.github.com/868376)), until I discovered that the [sparkTable](http://cran.r-project.org/web/packages/sparkTable/index.html) package should do this very much better, provided you are ...
null
CC BY-SA 2.5
null
2011-03-13T19:59:54.457
2011-03-13T19:59:54.457
null
null
930
null
8246
1
null
null
4
585
I am evaluating a Quadratic Discriminant Analysis (QDA) classifier on a high-dimensionality feature set. The features come from highly non-Gaussian distributions. However, when I transform the features to each have a Gaussian distribution in two different ways, the resulting classifiers performs worse than QDA applie...
Using QDA for Non-Gaussian distributions
CC BY-SA 2.5
0
2011-03-13T20:45:44.760
2014-10-21T08:35:13.920
null
null
3595
[ "distributions", "classification", "discriminant-analysis" ]
8247
2
null
8237
23
null
In the simplest case, when you have only one predictor (simple regression), say $X_1$, the $F$-test tells you whether including $X_1$ does explain a larger part of the variance observed in $Y$ compared to the null model (intercept only). The idea is then to test if the added explained variance (total variance, TSS, min...
null
CC BY-SA 2.5
null
2011-03-13T21:04:34.900
2011-03-13T21:38:19.687
2011-03-13T21:38:19.687
930
930
null
8248
2
null
8236
2
null
First, the size of the dataset. I recommend taking small, tractable samples of the dataset (either by randomly choosing N datapoints, or by randomly choosing several relatively small rectangles in the X-Y plane and taking all points that fall within that plane) and then honing your analysis techniques on this subset. ...
null
CC BY-SA 2.5
null
2011-03-13T21:29:15.393
2011-03-13T21:29:15.393
null
null
3595
null
8249
2
null
8182
1
null
The following example (taken from kernlab reference manual) shows you how to access the various components of the kernel PCA: ``` data(iris) test <- sample(1:50,20) kpc <- kpca(~.,data=iris[-test,-5],kernel="rbfdot",kpar=list(sigma=0.2),features=2) pcv(kpc) # returns the principal component vectors eig(kpc) ...
null
CC BY-SA 3.0
null
2011-03-13T23:02:22.433
2014-09-19T12:33:41.923
2014-09-19T12:33:41.923
28666
21360
null
8250
2
null
8243
7
null
Just a remark: is there an inequality constraint $\sum_{i=1}^{n} w_{i} \leq 1$ in your system? I merely ask because $\mu$ is usually the KKT multiplier for inequality constraints. If indeed there is an inequality constraint, you will need to satisfy more conditions than just $\nabla L = 0$ to attain optimality (i.e. du...
null
CC BY-SA 2.5
null
2011-03-14T03:05:50.457
2011-03-14T03:05:50.457
null
null
2833
null
8251
1
8259
null
11
6317
In a paper I was reading recently I came across the following bit in their data analysis section: > The data table was then split into tissues and cell lines, and the two subtables were separately median polished (the rows and columns were iteratively adjusted to have median 0) before being rejoined into a single tab...
The use of median polish for feature selection
CC BY-SA 2.5
null
2011-03-14T07:13:51.857
2011-03-14T13:06:06.607
2011-03-14T07:34:02.277
930
3014
[ "feature-selection", "median", "genetics" ]
8252
2
null
8251
4
null
You may find some clues in pages 4 and 5 of [this](http://www.stats.ox.ac.uk/pub/MASS4/VR4stat.pdf) It is a method of calculating residuals for the model $$y_{i,j} = m + a_i + b_j + e_{i,j}$$ by calculating values for $m$, $a_i$ and $b_j$ so that if the $e_{i,j}$ are tabulated, the median of each row and of each colum...
null
CC BY-SA 2.5
null
2011-03-14T08:02:07.447
2011-03-14T08:02:07.447
null
null
2958
null
8253
2
null
8243
6
null
Here is the example of implementation with R. R is flexible in regards of combining symbolic differentiation and numerical optimisation. This means that you can get from symbolic expression to function used in numerical optimisation quite fast. The cost is of course speed, since hand-written functions will certainly wo...
null
CC BY-SA 2.5
null
2011-03-14T09:10:13.773
2011-03-14T09:10:13.773
null
null
2116
null
8254
1
8255
null
12
10094
Lets say I am regressing Y on X1 and X2, where X1 is a numeric variable and X2 is a factor with four levels (A:D). Is there any way to write the linear regression function `lm(Y ~ X1 + as.factor(X2))` so that I can choose a particular level of X2 -- say, B -- as the baseline?
Choose factor level as dummy base in lm() in R
CC BY-SA 2.5
null
2011-03-14T09:16:32.003
2011-03-18T16:17:07.760
2011-03-18T16:17:07.760
null
3671
[ "r" ]
8255
2
null
8254
15
null
You can use `relevel()` to change the baseline level of your factor. For instance, ``` > g <- gl(3, 2, labels=letters[1:3]) > g [1] a a b b c c Levels: a b c > relevel(g, "b") [1] a a b b c c Levels: b a c ```
null
CC BY-SA 2.5
null
2011-03-14T09:21:08.567
2011-03-14T09:21:08.567
null
null
930
null
8257
2
null
8251
3
null
Looks like you are reading a paper that has some gene differential expression analysis. Having done some research involving microarray chips, I can share what little knowledge (hopefully correct) I have about using median polish. Using median polish during the summarization step of microarray preprocessing is somewhat ...
null
CC BY-SA 2.5
null
2011-03-14T10:18:31.373
2011-03-14T10:56:54.570
2011-03-14T10:56:54.570
3704
3704
null
8258
2
null
4099
4
null
I believe Belsely said that CI over 10 is indicative of a possible moderate problem, while over 30 is more severe. In addition, though, you should look at the variance shared by sets of variables in the high condition indices. There is debate (or was, last time I read this literature) on whether collinearity that in...
null
CC BY-SA 2.5
null
2011-03-14T10:57:21.963
2011-03-14T10:57:21.963
null
null
686
null
8259
2
null
8251
11
null
Tukey Median Polish, algorithm is used in the [RMA](http://bmbolstad.com/misc/ComputeRMAFAQ/ComputeRMAFAQ.html) normalization of microarrays. As you may be aware, microarray data is quite noisy, therefore they need a more robust way of estimating the probe intensities taking into account of observations for all the pro...
null
CC BY-SA 2.5
null
2011-03-14T11:43:23.427
2011-03-14T13:06:06.607
2011-03-14T13:06:06.607
1307
1307
null
8260
1
8270
null
3
572
I've known that, in orthogonal rotation, if the rotation matrix has determinant of -1 then reflection is present. Otherwise the determinant is +1 and we have pure rotation. May I extend this "sign-of-determinant" rule for non-orthogonal rotations? Such as orthogonal-into-oblique axes or oblique-into-orthogonal axes rot...
Detecting reflection in non-orthogonal rotation
CC BY-SA 2.5
null
2011-03-14T12:12:27.620
2011-03-14T15:38:45.710
2011-03-14T15:38:45.710
919
3277
[ "rotation" ]
8261
1
null
null
7
1910
If $X$ is a $m × n$ matrix, where $m$ is the number of measurement types (variables) and $n$ is the number of samples, would it be correct to perform a PCA on a matrix that has $m \geq n$ ? If not, please provide some arguments why would this be a problem. I remember having heard that doing such an analysis would be in...
Is the matrix dimension important for performing a valid PCA?
CC BY-SA 2.5
null
2011-03-14T12:19:15.427
2011-12-01T01:01:28.680
null
null
3467
[ "pca" ]
8263
2
null
8261
2
null
I do not think that you would get any useful information from such an analysis, as lore in my subject area (psychology) suggests a 10;1 ratio in favour of n as a precondition. In some circumstances (where communalities are high) you can get away with 5 or 3 to 1, but a ratio of less than 1 is probably a recipe for disa...
null
CC BY-SA 2.5
null
2011-03-14T12:37:29.147
2011-03-14T12:37:29.147
null
null
656
null
8264
2
null
8261
3
null
PCA of variables. Number of observations n is low relative to number of variables. 1) Mathematical aspect. Whenever n<=m correlation matrix is singular which means some of last m principle components are zero-variance, that is, they are not existant. This is not a problem to PCA, generally speaking, since you could jus...
null
CC BY-SA 2.5
null
2011-03-14T12:52:57.630
2011-03-14T12:52:57.630
null
null
3277
null
8265
2
null
7103
2
null
You could use any probabilistic time series model in combination with [arithmetic coding](http://en.wikipedia.org/wiki/Arithmetic_coding). You'd have to quantize the data, though. Idea: the more likely an "event" is to occur, the more bits for that event are reserved. E.g if $p(x_t = 1| x_{1:t-1}) = 0.5$ with $x_{1:t-1...
null
CC BY-SA 2.5
null
2011-03-14T12:55:11.880
2011-03-14T12:55:11.880
null
null
2860
null
8266
1
8284
null
4
6875
I have a lot of data on previous race history and I'm trying to predict a percentage chance of winning the next race using Regression, kNN, and SVM learning algorithms. Say a race has 5 runners, and each runner has a previous best course time of, say $T_i$ (seconds). I've also introduced an additional input for RANK of...
Advice on classifier input correlation
CC BY-SA 2.5
null
2011-03-14T13:43:20.683
2011-03-14T20:02:55.153
2011-03-14T15:15:59.677
null
null
[ "machine-learning", "correlation" ]
8267
1
8269
null
4
41796
In R, I am trying to write a function to subset and exclude observations in a data frame based on three variables. My data looks something like this: ``` data.frame': 43 obs. of 8 variables: $ V1: chr "ENSG00000008438" "ENSG00000048462" "ENSG00000006075" "ENSG00000049130" ... $ V2: chr "ENST00000008938" "EN...
Help on subsetting data frames using multiple logical operators in R
CC BY-SA 2.5
null
2011-03-14T14:30:10.763
2011-03-15T07:55:15.623
2011-03-14T14:41:49.677
3705
3705
[ "r" ]
8268
2
null
8266
2
null
I think it depends on if the purpose of your model is descriptive (e.g. considering variable importance or hypothesis tests in the regression) or purley predictive. If it is the former, then certainly input features that are strongly correlated will create difficulties in making inference about how variables impact the...
null
CC BY-SA 2.5
null
2011-03-14T14:42:57.020
2011-03-14T14:42:57.020
null
null
2040
null
8269
2
null
8267
6
null
You are using subset wrongly. The syntax of subset is > pruned1 <- subset(x, !( V5 == 1 & V7 > 113818477 & V8 < 114658477) ) ("!" is the negation operator) and not > pruned1 <- subset(x[-which(x$V5 == 1 & x$V7 > 113818477 & x$V8 < 114658477) Hope that helps PS You might want to look into whether using...
null
CC BY-SA 2.5
null
2011-03-14T15:07:22.570
2011-03-14T17:11:35.753
2011-03-14T17:11:35.753
2807
2807
null
8270
2
null
8260
2
null
When the determinant is negative, composing with any reflection will give a positive determinant. In that sense you are correct. However, in another sense the question does not appear to be meaningful, because the matrix you give, although it is row normalized, is not orthogonal (it is not a "rotation," nor--unlike r...
null
CC BY-SA 2.5
null
2011-03-14T15:16:08.273
2011-03-14T15:16:08.273
null
null
919
null
8271
1
null
null
2
11442
I wanted to carry out a two-way ANCOVA for my data. However, SPSS isn't liking that I have only one IV. I have - One IV: Group (3 levels, i.e. 2 experimental groups and a control group), - One DV: outcome measure (2 levels, i.e. time 1 and time 2), - One covariate (I have checked and this demographic continuous va...
How to set up a two-way mixed ANOVA with a covariate in SPSS?
CC BY-SA 3.0
null
2011-03-14T15:36:51.410
2011-04-15T04:13:26.403
2011-04-15T04:13:26.403
183
null
[ "spss", "repeated-measures", "ancova" ]
8272
2
null
8267
1
null
Another way to do this is ``` y <- x[ !(x$V5 == 1 & x$V7 > 113818477 & x$V8 < 114658477) & !(x$V5 == 1 & x$V7 > 192461456 & x$V8 < 192549912), ] ``` Also, V5 is a character variable, so `x$V5 == “1”` might be preferable -- e.g., if you have any codes that are actually formatted as " 1", you wi...
null
CC BY-SA 2.5
null
2011-03-14T16:00:19.347
2011-03-14T16:00:19.347
null
null
3432
null
8273
1
null
null
14
11500
I got asked something similar to this in interview today. The interviewer wanted to know what is the probability that an at-the-money option will end up in-the-money when volatility tends to infinity. I said 0% because the normal distributions that underly the Black-Scholes model and the random walk hypothesis will hav...
What is the probability that a normal distribution with infinite variance has a value greater than its mean?
CC BY-SA 2.5
null
2011-03-14T16:19:27.127
2018-08-24T12:23:08.450
null
null
2283
[ "normal-distribution", "variance" ]
8274
2
null
8273
14
null
Neither form of reasoning is mathematically rigorous--there's no such thing as a normal distribution with infinite variance, nor is there a limiting distribution as the variance grows large--so let's be a little careful. In the Black-Scholes model, the log price of the underlying asset is assumed to be undergoing a ran...
null
CC BY-SA 2.5
null
2011-03-14T17:02:26.200
2011-03-14T18:34:18.040
2011-03-14T18:34:18.040
919
919
null
8275
2
null
8236
4
null
The type of data you describe is ususally called "marked point patterns", R has a task view for spatial statistics that offers many good packages for this type of analysis, most of which are probably not able to deal with the kind of humongous data you have :( > For example, maybe events of type A usually don't occur...
null
CC BY-SA 2.5
null
2011-03-14T17:17:15.127
2011-03-14T17:17:15.127
null
null
1979
null
8276
1
8326
null
3
515
The two main packages I use at work are Palisade Risk and SPSS Clementine - they are both quite old versions and I've been supplementing the ability to analyze properly at work with more modern abilities available at home. E .g.at home I've been testing RapidMiner 5, which I really like in principle but have experience...
Help with deploying a model
CC BY-SA 2.5
null
2011-03-14T17:26:32.603
2011-03-15T17:14:46.560
null
null
null
[ "machine-learning", "software" ]
8277
2
null
8130
1
null
The test you probably want is [Fisher's exact test](http://en.wikipedia.org/wiki/Fisher%27s_exact_test). Unfortunately, given the likely very low click-through rate and small expected effect size, you will need enormous N to achieve the confidence interval you want. Lets say that the 'true' click-through rate of your b...
null
CC BY-SA 2.5
null
2011-03-14T17:32:09.420
2011-03-15T02:41:01.220
2011-03-15T02:41:01.220
82
82
null
8278
1
8325
null
3
162
I am planning a study to collect data of patients dying after brain infection versus number of cases for the next 5 years in 2 cities where they manage the disease with different drugs. - Will a year wise t-test be better or year wise Relative Risk of death and meta analysis be better to compare the results of the stu...
How to assess drug effects using annual death rate data?
CC BY-SA 2.5
null
2011-03-14T17:53:57.350
2011-03-15T17:10:20.340
2011-03-15T07:13:19.640
2116
2956
[ "meta-analysis", "experiment-design", "t-test", "relative-risk" ]
8279
2
null
8187
1
null
I'm not sure why time series is not being accepted as a solution to your problem since this is equally spaced chronological data . Confounding variables although unknown in nature can be proxied by both ARIMA structure and/or Detectable Interventions. I'm not sure who is not accepting that time series analysis is ap...
null
CC BY-SA 2.5
null
2011-03-14T18:12:36.827
2011-03-14T18:12:36.827
null
null
3382
null
8280
2
null
8273
-2
null
You should be doing your analysis based on a log normal distribution, not a normal one. You interviewer is wrong when he states that the distribution is symmetrical. It would never be, regardless of the variance. You also need to distinguish between volatility and what you are calling infinite variance. A stocks price...
null
CC BY-SA 2.5
null
2011-03-14T18:17:05.443
2011-03-14T18:17:05.443
null
null
3489
null
8281
1
null
null
8
320
The two-sample Kolmogorov-Smirnov statistic is normally defined as $D = \max_x |A(x) - B(x)|.$ I would like to compute a variant that retains the sign of the difference between the distribution functions: $D^\prime = A(x) - B(x) \quad\text{where}\quad x = \arg\max_x |A(x) - B(x)|.$ What is the right name of $D^\prime$?...
What is the right name for the variant of the Kolmogorov-Smirnov statistic that retains the sign of the difference?
CC BY-SA 2.5
null
2011-03-14T18:19:51.103
2012-03-09T02:49:46.733
2011-03-14T18:45:55.043
220
220
[ "kolmogorov-smirnov-test" ]
8282
2
null
8281
1
null
It looks like a variant of [Kuiper's test](http://en.wikipedia.org/wiki/Kuiper%27s_test) to me, although Kuiper's V = D+ + D− ≠ D'.
null
CC BY-SA 2.5
null
2011-03-14T18:33:40.373
2011-03-14T18:33:40.373
null
null
3582
null
8283
1
null
null
2
789
I know that Mclust does the fit on its own but I am trying to implement an optimization with the aim to generate a mixture of 2 gaussians with the combine moments as closed as possible to the moment of my returns' distribution. The objective is to `Min Abs((Mean Ret - MeanFit)/Mean Fit) + Abs((Std Ret -Stdev Fit)/Std...
Fitting 4-moment distribution with mixture gaussian
CC BY-SA 2.5
null
2011-03-14T17:42:26.557
2011-03-27T16:03:13.370
2011-03-27T16:03:13.370
919
null
[ "r", "distributions", "optimization", "mixture-distribution" ]
8284
2
null
8266
5
null
It depends on the classifier. Some classifiers (such as Naive Bayes) explicitly assume feature independence, so they might behave in unexpected ways. Other classifiers (such as SVM) care about it much less. In image analysis it is routine to throw thousands of highly correlated features at SVM, and SVM seems to perform...
null
CC BY-SA 2.5
null
2011-03-14T20:02:55.153
2011-03-14T20:02:55.153
null
null
3369
null
8285
1
null
null
2
5829
I am a novice when it comes to stats, so I apologize beforehand for the simplicity of my question. I trying to figure out the best way to normalize (this may be the wrong term) my data in so that the maximum value is 1 and the minimum value is 0. What are my options and what methods would you suggest as the best? My da...
Normalizing data between 0 and 1
CC BY-SA 2.5
null
2011-03-14T20:48:28.090
2011-08-08T17:35:19.670
2011-08-08T17:35:19.670
919
1514
[ "normalization" ]
8286
1
null
null
4
112
I have this dataset with size (rows) and shape (columns) and in each cell #disease/#in cell . How would I answer the following questions? Is size an indicator of disease? Is shape an indicator of disease? Is there a size*shape effect? ``` Size shapea shapeb shapec %a %b %c <4 mm ...
Indicators of disease
CC BY-SA 2.5
null
2011-03-14T21:04:46.997
2011-03-16T09:38:20.743
2011-03-16T09:38:20.743
930
null
[ "proportion" ]
8287
2
null
1112
1
null
My earlier post has a method to rank between 0 and 1. [Advice on classifier input correlation](https://stats.stackexchange.com/questions/8266/advice-on-classifier-input-correlation) However, the ranking I have used, Tmin/Tmax uses the sample min/max but you may find the population min/max more appropriate. Also look up...
null
CC BY-SA 2.5
null
2011-03-14T21:20:55.353
2011-03-14T21:20:55.353
2017-04-13T12:44:51.217
-1
null
null
8289
2
null
8286
5
null
You can use [logistic regression](http://en.wikipedia.org/wiki/Logistic_regression) to answer these questions. Disease is the outcome. Fitting a model with size and shape as covariates will allow you to test for a size effect and a shape effect, and adding an interaction between size and shape will allow you to test fo...
null
CC BY-SA 2.5
null
2011-03-14T21:42:36.733
2011-03-14T21:42:36.733
null
null
449
null
8290
1
8295
null
4
4831
I have data in this format: Words,Source,Result pestology Gomel, cheap, 0 cocreating, cheap, 1 munitioner impersonating nonextinct, cheap, 1 Kolomna, expensive, 1 Enyo's snakemouth, expensive, 0 blueberries backare farriers, cheap, 0 markets rafales, cheap, 0 ... [http://bit.ly/h2ynoG](http://bit.ly/h2ynoG) How shoul...
How should I measure the relationship between a variable containing text and a binomial variable?
CC BY-SA 2.5
null
2011-03-14T22:23:47.850
2011-03-15T19:11:31.293
2011-03-15T19:11:31.293
3489
3712
[ "correlation", "binomial-distribution", "text-mining" ]
8291
1
8294
null
10
5842
Stata allows estimating clustered standard errors in models with fixed effects but not in models random effects? Why is this? By clustered standard errors, I mean clustering as done by stata's cluster command (and as advocated in Bertrand, Duflo and Mullainathan). By fixed effects and random effects, I mean varying-in...
Clustered standard errors and multi-level models
CC BY-SA 2.5
null
2011-03-14T22:28:24.027
2017-02-02T22:51:09.600
2017-02-02T22:51:09.600
28666
3700
[ "mixed-model", "multilevel-analysis", "clustered-standard-errors" ]
8292
1
null
null
0
4592
I have got a strange problem with using functions which are supposed to be in the libraries lmtest & language R (downloaded from cran.r-project recently), namely lrtest() and pvals.fnc() - however, they are not available. I have upgraded my R-version to 2.12.2 but it has not solved the problem. ``` library(lmtest) lrte...
No lrtest() function available in lmtest
CC BY-SA 2.5
null
2011-03-14T23:04:00.050
2015-09-07T07:01:00.433
2011-03-15T00:10:00.890
null
null
[ "r" ]
8293
2
null
8292
4
null
post your `sessionInfo()`. `lmtest:::lrtest(x)` should call a generic function which then determines the appropriate code to run on 'x'. If you have not updated your packages, you may perhaps need to do so, or simply re-run `install.packages('lmtest')` for your updated R install.
null
CC BY-SA 3.0
null
2011-03-14T23:12:21.900
2015-09-07T07:01:00.433
2015-09-07T07:01:00.433
84191
317
null
8294
2
null
8291
12
null
When you cluster on some observed attribute, you are making a statistical correction to the standard errors to account for some presumed similarity in the distribution of observations within clusters. When you estimate a multi-level model with random effects, you are explicitly modeling that variation, not treating it ...
null
CC BY-SA 2.5
null
2011-03-15T01:01:45.957
2011-03-15T01:01:45.957
null
null
3265
null
8295
2
null
8290
4
null
I would start by transforming the phrases into numbers via a document term matrix, with a 1 denoting the presence of a word and 0 being the absence of a word. Then you can perform correlation analysis. [http://en.wikipedia.org/wiki/Document-term_matrix](http://en.wikipedia.org/wiki/Document-term_matrix) R Code ![enter...
null
CC BY-SA 2.5
null
2011-03-15T02:13:29.387
2011-03-15T16:55:53.313
2011-03-15T16:55:53.313
3489
3489
null
8297
1
8313
null
6
1635
I am looking for a self-study site on the web that will allow me to verify my understanding of some basic probability and stats concepts and operations. What I would like is a site with data and problems (along with the solutions) that I could use to practice my skills (such as regression methods/analysis, pairwise t-t...
Looking for stats/probability practice problems with data and solutions
CC BY-SA 3.0
null
2011-03-15T04:06:00.550
2016-12-20T23:54:15.153
2016-12-20T23:54:15.153
22468
10633
[ "r", "probability", "self-study", "references", "excel" ]
8298
2
null
8297
6
null
If you are interested in Statistical Machine Learning, which seems to be THE thing these days, [Tibshirani, Hastie, and Friedman's book](http://www-stat.stanford.edu/~tibs/ElemStatLearn/) is an invaluable resource. It is the latest edition and has a self contained website devoted to it.
null
CC BY-SA 2.5
null
2011-03-15T04:09:32.143
2011-03-15T04:09:32.143
null
null
1307
null
8299
1
8302
null
4
145
While trying to make sense of MDL and stochastic complexity, I found this previous question: [Measures of model complexity](https://stats.stackexchange.com/questions/2828), in which Yaroslav Bulatov defines model complexity as "how hard it is to learn from limited data." It is not clear to me how Minimal Description Le...
Relationship between MDL and "difficulty of learning from data"
CC BY-SA 2.5
null
2011-03-15T05:44:31.573
2011-03-16T20:23:20.790
2017-04-13T12:44:24.677
-1
3567
[ "model-selection" ]
8300
1
null
null
5
2653
I am investigating the effect of a drug on EEG and cognition in epilepsy patients. We have done EEG and neuropsychological (NP) tests twice, before and after medical treatment. Some of parameters in EEG and NP tests were significantly altered after drug treatment (done by Wilcoxon rank sum test, as the distribution was...
Correlation analysis and correcting $p$-values for multiple testing
CC BY-SA 3.0
null
2011-03-15T06:59:28.983
2012-07-04T15:47:08.500
2012-07-04T15:47:08.500
4856
null
[ "correlation", "multiple-comparisons", "permutation-test" ]
8301
2
null
8300
4
null
In my opinion you should test if your variables are distributed normally and chose a suitable test accordingly. Concerning the correction for alpha inflation: What you are doing is data mining. You have experimental data and now you are digging in it to find ... anything. Do that. But also know that anything you might...
null
CC BY-SA 2.5
null
2011-03-15T07:31:45.437
2011-03-15T07:31:45.437
null
null
1048
null
8302
2
null
8299
4
null
The worst case of code length of a code induced by a probability density is just the negative log of the most unlikely event, since $L_p(x) = -\log p(x)$. I am currently working through Peter Grünwald's book 'The MDL principle'. He defines the complexity of a model class as the log of the sum of probabilities it can as...
null
CC BY-SA 2.5
null
2011-03-15T07:36:50.213
2011-03-15T07:42:07.103
2011-03-15T07:42:07.103
2860
2860
null
8303
1
null
null
53
52386
I am fitting a binomial family glm in R, and I have a whole troupe of explanatory variables, and I need to find the best (R-squared as a measure is fine). Short of writing a script to loop through random different combinations of the explanatory variables and then recording which performs the best, I really don't know ...
How to do logistic regression subset selection?
CC BY-SA 3.0
null
2011-03-15T07:45:52.233
2020-01-18T17:07:55.563
2017-07-08T08:23:47.843
79696
3721
[ "r", "logistic" ]
8304
2
null
8267
8
null
If you are using `which`, then `subset` is unnecessary. If we have a logical condition these are equivalent in R: ``` data[cond,] data[which(cond),] subset(data,cond) ``` The benefit of the subset is that you do not need to use `$` to get to the variables you are subsetting on. Furthermore if you do successive subseti...
null
CC BY-SA 2.5
null
2011-03-15T07:55:15.623
2011-03-15T07:55:15.623
null
null
2116
null
8305
2
null
8303
17
null
First of all $R^2$ is not an appropriate goodness-of-fit measure for logistic regression, take an information criterion $AIC$ or $BIC$, for example, as a good alternative. Logistic regression is estimated by maximum likelihood method, so `leaps` is not used directly here. An extension of `leaps` to `glm()` functions is...
null
CC BY-SA 2.5
null
2011-03-15T08:54:26.503
2011-03-15T08:54:26.503
null
null
2645
null
8306
1
8308
null
15
9139
As title, is there anything like this? I know how to calculate CI for arithmetic mean, but how about geometric mean? Thanks.
Confidence interval for geometric mean
CC BY-SA 2.5
null
2011-03-15T10:02:23.260
2013-03-27T07:09:52.933
2011-03-15T12:03:24.493
null
588
[ "confidence-interval", "mean" ]
8307
2
null
1112
29
null
As often, my first question was going to be "why do you want to do this", then I saw you've already answered this in the comments to the question: "I am measuring content across many different dimensions and I want to be able to make comparisons in terms of how relevant a given piece of content is. Additionally, I want...
null
CC BY-SA 2.5
null
2011-03-15T10:04:23.910
2011-03-15T10:49:20.283
2011-03-15T10:49:20.283
449
449
null
8308
2
null
8306
20
null
The geometric mean $(\prod_{i=1}^n X_i)^{1/n}$ is an arithmetic mean after taking logs $1/n \sum_{i=1}^n \log X_i$, so if you do know the CI for the arithmetic mean do the same for the logarithms of your data points and take exponents of the upper and lower bounds.
null
CC BY-SA 2.5
null
2011-03-15T10:17:39.707
2011-03-15T15:51:17.957
2011-03-15T15:51:17.957
919
2645
null
8309
1
null
null
11
8325
Let A be $n \times p$ matrix of independent variables and B be the corresponding $n \times 1$ matrix of the dependent values. In ridge regression, we define a parameter $\lambda$ so that: $\beta=(A^\mathrm{T}A+\lambda I)^{-1}A^\mathrm{T}B$ . Now let [u s v]=svd(A) and $d_{i}=i^{th}$ diagonal entry of 's'. we define de...
How to calculate regularization parameter in ridge regression given degrees of freedom and input matrix?
CC BY-SA 2.5
null
2011-03-15T10:34:15.403
2018-10-29T00:37:23.980
2011-03-15T10:47:46.733
3722
3722
[ "ridge-regression" ]
8310
2
null
7939
3
null
The conditional mean is defined by: $$E(Y|X)\equiv\int y f(y|x) dy$$ Where $f(Y|X)$ is the conditional density. Using the product rule, you can show: $$f(y|x)=\frac{f(y,x)}{f(x)}$$ Substituting this back into the integral you get $$E(Y|X)\equiv\frac{\int y f(y,x) dy}{f(x)}$$ Which is of the form you seek, if you use t...
null
CC BY-SA 2.5
null
2011-03-15T10:42:34.337
2011-03-15T10:42:34.337
null
null
2392
null
8312
2
null
8303
31
null
Stepwise and "all subsets" methods are generally bad. See Stopping Stepwise: [Why Stepwise Methods are Bad and what you Should Use](http://www.nesug.org/proceedings/nesug07/sa/sa07.pdf) by David Cassell and myself (we used SAS, but the lesson applies) or Frank Harrell Regression Modeling Strategies. If you need an au...
null
CC BY-SA 2.5
null
2011-03-15T11:20:17.760
2011-03-15T11:20:17.760
null
null
686
null
8313
2
null
8297
5
null
The [Statistics topic area on Wikiversity](http://en.wikiversity.org/wiki/Statistics) is worth a look. It's got a long way to go before it's a comprehensive stand-alone syllabus, to be honest, but some of the Courses are more advanced than others, and when there's not much material as yet there are often links to free ...
null
CC BY-SA 2.5
null
2011-03-15T11:26:34.293
2011-03-15T11:26:34.293
null
null
449
null
8314
2
null
8297
4
null
I realise that this may not be what you are looking for, but R core and all packages come with data sets on which to practice the functionalities in each package. Many of these data sets are quite famous, and often a link is given to the paper in which the data are described. You could use these datasets in R and then ...
null
CC BY-SA 2.5
null
2011-03-15T11:37:46.567
2011-03-15T11:37:46.567
null
null
656
null
8315
2
null
8309
11
null
A Newton-Raphson/Fisher-scoring/Taylor-series algorithm would be suited to this. You have the equation to solve for $\lambda$ $$h(\lambda)=\sum_{i=1}^{p}\frac{d_{i}^{2}}{d_{i}^{2}+\lambda}-df=0$$ with derivative $$\frac{\partial h}{\partial \lambda}=-\sum_{i=1}^{p}\frac{d_{i}^{2}}{(d_{i}^{2}+\lambda)^{2}}$$ You then ge...
null
CC BY-SA 3.0
null
2011-03-15T12:11:19.050
2011-12-06T06:57:36.580
2011-12-06T06:57:36.580
930
2392
null
8316
1
8322
null
5
267
I assume a simple model $\log(y_i) \sim \mathcal{N}(\mu_i,\sigma)$ with $\mu_i=\alpha + \beta x_i$ . Now if I have the estimates $\hat{\alpha}$ and $\hat{\beta}$, how do I calculate the fitted values $\hat{y}$? (Using $\hat{y}= \exp(\hat{\alpha} + \hat{\beta} x_i)$ seems to work; this would be the median of the log-nor...
Fitted values for a log-normal model
CC BY-SA 2.5
null
2011-03-15T13:11:49.413
2011-03-15T15:17:13.680
2011-03-15T13:16:59.297
2970
1443
[ "modeling" ]
8317
2
null
8283
5
null
I am not exactly sure what your code is trying to do, but it seems like you should be using $rnorm()$ (with a large $n$) instead of $dnorm()$, since the functions $mean()$, $var()$, etc. are designed to be used on samples, not densities. In any case, using the method-of-moments is easy to do algebraically. Let's say yo...
null
CC BY-SA 2.5
null
2011-03-15T14:04:23.587
2011-03-15T14:27:33.083
2011-03-15T14:27:33.083
3567
3567
null
8318
1
null
null
22
43805
One of the predictors in my logistic model has been log transformed. How do you interpret the estimated coefficient of the log transformed predictor and how do you calculate the impact of that predictor on the odds ratio?
Interpretation of log transformed predictors in logistic regression
CC BY-SA 2.5
null
2011-03-15T14:27:14.323
2021-09-14T14:34:12.503
2020-03-03T04:57:07.913
11887
null
[ "regression", "logistic", "data-transformation" ]
8319
2
null
8309
6
null
Here is the small Matlab code based on the formula proved by probabilityislogic: ``` function [lamda] = calculate_labda(Xnormalised,df) [n,p] = size(Xnormalised); %Finding SVD of data [u s v]=svd(Xnormalised); Di=diag(s); Dsq=Di.^2; %Newton-rapson method to solve for lamda lamdaPrev=(p-...
null
CC BY-SA 4.0
null
2011-03-15T14:34:44.480
2018-10-17T13:26:14.680
2018-10-17T13:26:14.680
7290
3722
null
8320
2
null
8318
18
null
If you exponentiate the estimated coefficient, you'll get an odds ratio associated with a $b$-fold increase in the predictor, where $b$ is the base of the logarithm you used when log-transforming the predictor. I usually choose to take logarithms to base 2 in this situation, so I can interpet the exponentiated coeffic...
null
CC BY-SA 2.5
null
2011-03-15T14:40:15.637
2011-03-15T14:40:15.637
null
null
449
null
8321
1
null
null
5
5605
In multiple linear regression, let us say that the F test shows that the model is significant. But the t-tests for beta values does not say that the beta values are non-zero. What can we conclude in such a situation? Does the fact that the tests for the beta values failed affect the fact that the model is significant?
Significant multiple linear regression model with non-significant betas?
CC BY-SA 2.5
null
2011-03-15T15:02:17.730
2011-06-14T16:49:43.333
2011-03-16T13:05:34.637
null
3725
[ "multiple-regression" ]
8322
2
null
8316
3
null
The conditional expectation of $y_i$ at the value $x_i$ can be estimated as $\exp(\hat{\alpha} + \hat{\beta}x_i + s^2/2)$ where $s^2$ is the mean squared error in your regression (estimating $\sigma^2$). Don't trust this until you have closely looked for evidence of heteroscedasticity (i.e., changes in the true value ...
null
CC BY-SA 2.5
null
2011-03-15T15:17:13.680
2011-03-15T15:17:13.680
null
null
919
null
8323
2
null
8300
3
null
You want to perform a canonical correlation analysis. This will provide information about correlations among linear combinations of your sets of parameters, potentially uncovering stronger information of the type you seek. The [Wikipedia article](http://en.wikipedia.org/wiki/Canonical_correlation) explains the theory...
null
CC BY-SA 2.5
null
2011-03-15T15:33:39.937
2011-03-15T15:33:39.937
null
null
919
null
8324
2
null
8321
1
null
Read the section on tests of joint significance here: [http://www.people.fas.harvard.edu/~blackwel/ftests.pdf](http://www.people.fas.harvard.edu/~blackwel/ftests.pdf) Your F-test is of a different hypothesis than the t test, that all beta = 0, rather than some beta = 0.
null
CC BY-SA 2.5
null
2011-03-15T17:02:20.803
2011-03-15T17:02:20.803
null
null
1893
null
8325
2
null
8278
1
null
Since your data are categorical, a t test is likely inappropriate for any parameter I can think you might want to do inference on. Here is a brief intro to a very similar problem as yours: [http://walkerbioscience.com/word-files/Categorical%20data.doc](http://walkerbioscience.com/word-files/Categorical%20data.doc)
null
CC BY-SA 2.5
null
2011-03-15T17:10:20.340
2011-03-15T17:10:20.340
null
null
1893
null
8326
2
null
8276
0
null
R/Rapidminer are free. Deployment can get tricky if you are concerned about multiple GB datasets, but other than that, everything is a breeze. RStudio on a linux server has been getting great reviews, and Revolution Analytics sells an enterprise version of R at a very reasonable cost with a focus on enhanced deployabil...
null
CC BY-SA 2.5
null
2011-03-15T17:14:46.560
2011-03-15T17:14:46.560
null
null
1893
null
8327
2
null
8271
1
null
Set it up as a regular regression, they are mathematically equivalent, just make sure your non-continuous variables are defined appropriately (as categorical or whatever) to SPSS.
null
CC BY-SA 2.5
null
2011-03-15T18:43:25.903
2011-03-15T18:43:25.903
null
null
1893
null
8328
1
null
null
11
6268
I'm trying to implement an EM algorithm for the following factor analysis model; $$W_j = \mu+B a_j+e_j \quad\text{for}\quad j=1,\ldots,n$$ where $W_j$ is p-dimensional random vector, $a_j$ is a q-dimensional vector of latent variables and $B$ is a pxq matrix of parameters. As a result of other assumptions used for the ...
How to make a matrix positive definite?
CC BY-SA 2.5
0
2011-03-15T19:27:04.463
2011-03-17T20:09:34.710
2011-03-17T20:09:34.710
919
3499
[ "factor-analysis", "expectation-maximization" ]
8329
2
null
8321
5
null
One way that this could happen is to put two highly correlated predictors into your model. Because they are highly correlated, each of their coefficients will have relatively wide standard errors. As a result, these coefficients may not be statistically significant separately. Taken together, they may be a strong predi...
null
CC BY-SA 2.5
null
2011-03-15T19:59:57.180
2011-03-15T19:59:57.180
null
null
401
null
8330
1
null
null
1
1000
I have a multiple response (categories) question (Q11, ..., Q15). My problem is that the data-entry clerck repeats the answers in the same case. Example: ``` Q11 Q12 Q13 Q14 Q15 Case 1 001 003 015 001 022 (001 was type twice) Case 2 089 032 089 089 014 (089 was typed three times) ``` I need to find a way to id...
Multiple response question with duplicated answers
CC BY-SA 2.5
null
2011-03-15T20:31:46.950
2011-03-16T13:04:04.497
2011-03-16T13:04:04.497
null
null
[ "spss" ]
8332
2
null
8328
3
null
OK, since you're doing FA I'm assuming that $B$ is of full column rank $q$ and $q<p$. We need a few more details though. This may be a numerical problem; it may also be a problem with your data. How are you computing the inverse? Do you need the inverse explicitly, or can re-express the calculation as the solution to ...
null
CC BY-SA 2.5
null
2011-03-15T21:56:51.387
2011-03-17T18:21:42.010
2011-03-17T18:21:42.010
26
26
null
8333
2
null
7969
8
null
I'm answering my own question, but I found a pretty good solution, even if I do not fully understand it. Looking at the code from the GNU Scientific Library, here is how it samples gamma variables (`r` is the random number generator, `a` is $\alpha$ and `b` is $\beta$): ``` if (a < 1) { double u = gsl_rng_u...
null
CC BY-SA 2.5
null
2011-03-15T22:29:01.410
2011-03-16T18:15:03.767
2011-03-16T18:15:03.767
2067
2067
null
8334
1
8357
null
8
2378
I am trying to set up an automatic screen to detect structural breaks in large numbers of time series. The time series are weekly and represent behaviour of customers. I have set up a Chow test. I use the most recent 4 weeks and compare it to the preceding 22. I want to know if their recent behaviour has significantl...
Chow test or not?
CC BY-SA 2.5
null
2011-03-15T22:59:36.823
2015-11-17T11:07:46.493
2011-03-16T13:02:46.637
null
2997
[ "time-series", "hypothesis-testing", "chow-test", "change-point" ]
8335
1
8353
null
4
1725
I am a beginner in statistics and poor in mathematics. I am trying to to assess effect of intervention in one state versus another using annual data. ``` My data are State 1 State 2 Cases Deaths Cases Deaths 2004 1125 5 2024 254 2005 1213 5 1978 209 2006 1003 4 2294 217 20...
How to do Chow test for constancy of parameters across 2 groups
CC BY-SA 2.5
null
2011-03-15T23:30:08.777
2011-03-17T11:37:41.620
2011-03-16T13:01:26.090
null
2956
[ "statistical-significance", "spss", "chow-test" ]
8336
2
null
8206
3
null
Fully customizable [ggplot2](http://had.co.nz/ggplot2/) boxplot... ``` #bootstrap data <- data.frame(value=rnorm(100,mean = 0.5, sd = 0.2),group=0) #processing metaData <- ddply(data,~group,summarise, mean=mean(data$value), sd=sd(data$value), min=min(data$value), max=max(data$value), ...
null
CC BY-SA 2.5
null
2011-03-15T23:45:40.963
2011-03-16T00:07:39.330
2011-03-16T00:07:39.330
3376
3376
null
8337
2
null
1112
0
null
A very simple option is dividing each number in your data by the largest number in your data. If you have many small numbers and a few very large ones, this might not convey the information well. But it's relatively easy; if you think meaningful information is lost when you graph the data like this, you could try one...
null
CC BY-SA 2.5
null
2011-03-16T00:27:24.787
2011-03-16T00:27:24.787
null
null
3700
null
8338
1
8339
null
3
102
I'm looking at binomial data where I believe that the probability of the outcome is the product of two independent factors. If you think of it as a two step decision, - At the first step, there is a certain probability $p$ that you will have a success, and $1-p$ that you will have a failure. If you have a failure at ...
Estimating variability of unseen factor
CC BY-SA 2.5
null
2011-03-16T01:37:12.077
2011-03-17T12:41:40.457
null
null
287
[ "probability", "estimation", "binomial-distribution", "variance" ]
8339
2
null
8338
4
null
Supposing for independent $X$, $Y$, we know $E[X]$, $E[XY]$, $var(X)$, $var(XY)$. Thus we know $E[Y] = E[XY]/E[X]$, $E[X^2]=var(X) - E[X]^2$ and $E[(XY)^2]=var[XY]-E[XY]^2$. Since $E[(XY)^2] = E[X^2 Y^2] = E[X^2] E[Y^2]$ for independent $X$, $Y$, we have $E[Y^2] = E[(XY)^2]/E[X^2]$. To summarize, $$var(Y) = \frac{var(...
null
CC BY-SA 2.5
null
2011-03-16T01:46:27.583
2011-03-17T12:41:40.457
2011-03-17T12:41:40.457
2116
3567
null
8340
1
8346
null
2
670
Update: I wanted to clarify that this is a simulation. Sorry if I confused everyone. I have also used meaningful names for my variables. I am not a statistician so please correct me if I make a blunder in explaining what I want. In regard to my [previous question](https://stats.stackexchange.com/questions/7996/what-is-...
Comparing and understanding my linear regression result with a previous attempt
CC BY-SA 2.5
null
2011-03-16T03:51:14.743
2011-03-16T16:07:19.607
2017-04-13T12:44:39.283
-1
2164
[ "r", "regression", "experiment-design" ]
8342
1
8378
null
13
13242
I have a three level contingency table, with count data for several species, the host plant from which they were collected and whether that collection happened on a rainy day (this actually matters!). Using R, fake data might be something like this: ``` count <- rpois(8, 10) species <- rep(c("a", "b"), 4) host ...
Appropriate way to deal with a 3-level contingency table
CC BY-SA 3.0
null
2011-03-16T04:49:19.827
2014-06-19T14:20:21.280
2014-06-19T14:20:21.280
7290
3732
[ "r", "categorical-data", "log-linear" ]
8343
2
null
8340
1
null
This result looks great. One thing that I would recommend doing is looking at the residuals for each of the two models to see if there are any trends in the first model that are not present in the second. If the model has residuals with an approximately normal distribution then you won't need to add more terms like A^2...
null
CC BY-SA 2.5
null
2011-03-16T05:06:26.793
2011-03-16T05:06:26.793
null
null
3727
null
8344
1
8354
null
20
11018
I am trying to understand how influence functions work. Could someone explain in the context of a simple OLS regression \begin{equation} y_i = \alpha + \beta \cdot x_i + \varepsilon_i \end{equation} where I want the [influence function](http://en.wikipedia.org/wiki/Robust_statistics#Empirical_influence_function) for $\...
Influence functions and OLS
CC BY-SA 2.5
null
2011-03-16T06:50:47.653
2022-11-12T15:21:33.273
2022-11-12T15:21:33.273
11887
2693
[ "regression", "least-squares", "influence-function" ]
8345
2
null
8299
1
null
MDL for model selection seems to mean "choose model with lowest parametric complexity". Since parametric complexity is equal to worst case excess code length when you don't know the distribution, I bet it also gives you the number of observations needed to get close to true member of `M` in KL-divergence. Parametric co...
null
CC BY-SA 2.5
null
2011-03-16T07:16:45.877
2011-03-16T07:16:45.877
null
null
511
null
8346
2
null
8340
5
null
First, to begin with, I think it was ok to rephrase the question in your previous post, now I just remember I have read it, but all the discussion is lost. I beg pardons if the ideas here are repeated (was lazy to search for the original post). There are some doubts regarding your experimental scheme and conclusions: ...
null
CC BY-SA 2.5
null
2011-03-16T07:17:02.403
2011-03-16T07:17:02.403
null
null
2645
null