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
11037
2
null
11019
1
null
I find this interesting, you say that you somehow "know" that it does not belong to the classes given. Yet you do not then describe what precisely it is about that item that makes you think this. As soon as you suspect a class coming from "something else" (called SE from now on) you have basically begun to describe a...
null
CC BY-SA 3.0
null
2011-05-20T13:42:11.990
2011-05-20T13:42:11.990
null
null
2392
null
11039
1
null
null
2
1733
I want to run a multiple regression analysis measuring the effect of various independent variables on a continuous dependent variable measuring the strength of a political institution. The problem is that the data is measured in different years. Thus I might have data for countries A and B only for the year 2009 and fo...
How to use cross-section country samples of different years in multiple regression analysis?
CC BY-SA 3.0
null
2011-05-20T10:58:57.617
2011-05-21T05:08:42.717
null
null
null
[ "r", "regression", "stata" ]
11040
2
null
11009
44
null
You ask whether it's ever valid. Let me provide a common example, whose elucidation may suggest additional analytical approaches for you. The simplest example of an interaction is a model with one dependent variable $Z$ and two independent variables $X$, $Y$ in the form $$Z = \alpha + \beta' X + \gamma' Y + \delta' X ...
null
CC BY-SA 3.0
null
2011-05-20T14:07:16.690
2011-05-20T14:07:16.690
null
null
919
null
11041
2
null
7385
5
null
I had the same issue in my dissertation. In Stata, I just built myself a custom .ado program with two calls to xtgee. For this, I found the ["Modeling Health Care Costs and Counts"](http://harrisschool.uchicago.edu/faculty/web-pages/willard-manning.asp) slides/programs by Partha Deb, Willard Manning, and Edward Nort...
null
CC BY-SA 3.0
null
2011-05-20T14:15:43.860
2011-05-20T14:15:43.860
null
null
4691
null
11042
2
null
10985
3
null
For a general exponential family, we have the variance in the following form: $$Var(Y_{i})=\phi h(E[Y_{i}])$$ for some function $h(.)$. Using the [wikipedia definition of negative binomial](http://en.wikipedia.org/wiki/Negative_binomial_distribution) we have a pdf of: $$p(Y_{i}=y|r,p)={r+y-1 \choose y}p^{y}(1-p)^{r}\;...
null
CC BY-SA 3.0
null
2011-05-20T14:27:28.050
2011-05-20T14:27:28.050
null
null
2392
null
11044
2
null
11009
32
null
While it is often stated in textbooks that one should never include an interaction in a model without the corresponding main effects, there are certainly examples where this would make perfect sense. I'll give you the simplest example I can imagine. Suppose subjects randomly assigned to two groups are measured twice, ...
null
CC BY-SA 3.0
null
2011-05-20T15:07:08.627
2011-05-20T15:07:08.627
null
null
1934
null
11045
1
null
null
2
139
I am trying to study the public opinion concept linked to quantitative measurement of opinion distributions and i am trying to define major parameters and methods that can help me starting from a certain finite number of people replying to a survey to generalize the results of that survey to say that this result can be...
How to define specific population for Public Opinion
CC BY-SA 3.0
null
2011-05-20T15:19:52.550
2011-05-20T15:53:13.237
null
null
4531
[ "mathematical-statistics", "finite-population" ]
11046
2
null
11019
6
null
It sounds to me that the problem is one of "novelty detection", you want to identify test patterns of a type not seen in the training data. This can be achieved using the one-class support vector machine, which IIRC tries to construct a small volume in a kernel induced feature space that contains all (or a large fract...
null
CC BY-SA 3.0
null
2011-05-20T15:25:44.807
2011-05-20T15:25:44.807
null
null
887
null
11047
2
null
11045
1
null
The population is the sampling frame. If you're using some non-random sampling scheme like convenience sampling, the population is harder to define. Random samples of the same size from populations of different sizes have different margins of error; samples from smaller populations have smaller margins of error. Statis...
null
CC BY-SA 3.0
null
2011-05-20T15:53:13.237
2011-05-20T15:53:13.237
null
null
3874
null
11048
1
null
null
0
131
I want to determine the amount of food stamp fraud a retailer perpetrated based on food stamp sales in other stores. The retailer had both legitimate food stamps sales, and illegitimate sales. The illegitimate sales consisted of food stamps used to buy ineligible items or whee food stamps were illegally redeemed for ca...
Market share based on comparison of competitors' average sales
CC BY-SA 3.0
null
2011-05-20T17:48:11.040
2011-05-20T18:36:29.503
null
null
4694
[ "sample-size" ]
11049
1
null
null
4
979
I have a dataset of 380 samples of 6 variables. These variables are counts of different types of events in each of the 380 defined regions. These counts are per month, which means that I have several of these datasets (for now, I only have four months). When looking at the data, I can clearly see that there is some mis...
How to detect (and possibly estimate/interpolate) missing or incomplete data?
CC BY-SA 3.0
null
2011-05-20T17:53:41.003
2016-05-24T02:42:53.250
null
null
3699
[ "missing-data", "count-data" ]
11050
1
null
null
18
1439
I find that simple data analysis exercises can often help to illustrate and clarify statistical concepts. What data analysis exercises do you use to teach statistical concepts?
Learning statistical concepts through data analysis exercises
CC BY-SA 3.0
null
2011-05-20T18:18:51.617
2011-05-21T06:17:49.747
2011-05-20T18:22:22.097
930
485
[ "teaching" ]
11051
2
null
11039
0
null
I think that a Bayesian approach may solve your problem. But it depends on how many data you have. I ned did it, but I guesst's possible to estimate a hierarchical model, in which data are nested by country or time. For example, assume you have $i = 1, 2, ..., n$ countries and $t = 1, 2, ..., T$ years. For country $j$...
null
CC BY-SA 3.0
null
2011-05-20T18:32:50.783
2011-05-20T18:32:50.783
null
null
3058
null
11052
2
null
11048
2
null
If the proportion of illegitimate sales were known to be the same in all stores, then your problem would be strictly a statistical one. As it is, it's first and foremost a matter of content knowledge: on what bases are you able to estimate the proportion in this store as compared to in others? Do you have any other ...
null
CC BY-SA 3.0
null
2011-05-20T18:36:29.503
2011-05-20T18:36:29.503
null
null
2669
null
11053
2
null
11050
5
null
Multiple Regression Coefficients and the Expected Sign Fallacy One of my favorite illustrations of a statistical concept through a data analysis exercise is the deconstruction of a multiple regression into multiple bivariate regressions. Objectives - To clarify the meaning of regression coefficients in the presence ...
null
CC BY-SA 3.0
null
2011-05-20T18:39:55.037
2011-05-21T06:17:49.747
2011-05-21T06:17:49.747
2116
485
null
11054
1
11057
null
7
7223
For my classification problem, I am trying to classify an object as Good or Bad. I have been able to create a good first classification step that separates the data into 2 groups using SVM. After tuning the parameters for the SVM using a training/holdout set (75% training, 25% holdout), I obtained the following result...
Training multiple models for classification using the same dataset
CC BY-SA 4.0
null
2011-05-20T18:43:03.960
2019-03-12T17:41:00.700
2019-03-12T17:41:00.700
128677
2252
[ "machine-learning", "classification" ]
11055
2
null
11049
3
null
I think you are really looking for outliers in your data (small values where most 'similar' values, i.e. values where a set of covariates hold the same values, are 'bigger'). You could look at [outliers in MV data](https://stats.stackexchange.com/questions/213/what-is-the-best-way-to-identify-outliers-in-multivariate-d...
null
CC BY-SA 3.0
null
2011-05-20T19:34:15.570
2011-05-20T19:34:15.570
2017-04-13T12:44:24.667
-1
4257
null
11056
2
null
11054
6
null
I would use the same training dataset for both models, and use the same CV-folds for tuning. Don't use ANY of the 25% hold-out for training or tuning. Once you've fit your 2 models on the 75% training sample, evaluate your performance using the holdout. If you are using R, the caret package has functions for creating...
null
CC BY-SA 3.0
null
2011-05-20T19:38:54.947
2011-05-24T18:00:35.007
2011-05-24T18:00:35.007
2817
2817
null
11057
2
null
11054
3
null
Just to make sure that we are on the same page, I take it from your description that you consider a supervised learning problem where you know the Good/Bad status of your objects and where you have a vector of features for each object that you want to use to classify the object as either Good or Bad. Moreover, the resu...
null
CC BY-SA 3.0
null
2011-05-20T19:51:32.450
2011-05-20T20:03:08.883
2011-05-20T20:03:08.883
4376
4376
null
11058
2
null
3104
4
null
At risk of sounding too simplistic, I think the best problem to introduce depends on who you are talking to. For example my arts friends freak out when I talk about math and stats, but then I tell them they shouldn't be afraid because they speak math all the time. So I give them examples such as "What are the odds it w...
null
CC BY-SA 3.0
null
2011-05-20T19:55:14.197
2011-05-20T19:55:14.197
null
null
4673
null
11059
2
null
11050
9
null
As I have to explain variable selection methods quite often, not in a teaching context, but for non-statisticians requesting aid with their research, I love this extremely simple example that illustrates why single variable selection is not necessarily a good idea. If you have this dataset: ``` y X1 x2 1 ...
null
CC BY-SA 3.0
null
2011-05-20T20:15:32.913
2011-05-20T20:15:32.913
null
null
4257
null
11060
1
11063
null
6
4430
I'm hoping someone can help me sort out how the proportion comparisons using a GLM works in R. I'm comparing hatch success among multiple years (and later, sites). I've used a GLM to compare among years by making a txt file where the success column contains the number of chicks that hatched, and failures are the number...
GLM for proportional data
CC BY-SA 3.0
null
2011-05-20T20:57:49.180
2011-05-21T01:06:56.623
2011-05-21T01:06:56.623
4238
4238
[ "r", "generalized-linear-model", "proportion" ]
11061
2
null
3104
1
null
For a gentle introduction, I like examples using 2x2 contingency tables. The diagnostic testing example as mentioned above, where the Probability of a positive test result given disease is not equal to the Probability of disease given a positive test result. Also, one can use designs with different sampling schemes, ...
null
CC BY-SA 3.0
null
2011-05-20T21:19:25.467
2011-05-20T21:19:25.467
null
null
2312
null
11063
2
null
11060
2
null
Logistic regression, like this is, assumes a binomial distribution, or, as I prefer, a Bernoulli distribution per event. I know of no case nor reason where this should not be safely assumed by itself (either it happens or it doesn't, and in a population you can always assign a probability to this). There is no reason t...
null
CC BY-SA 3.0
null
2011-05-20T22:08:44.360
2011-05-20T22:08:44.360
null
null
4257
null
11064
1
11065
null
21
10303
In a number of statistical packages including SAS, SPSS and maybe more, there is an option to "suppress the intercept". Why would you want to do that?
Why would one suppress the intercept in linear regression?
CC BY-SA 3.0
null
2011-05-20T22:18:14.793
2019-11-04T01:23:45.863
2019-11-04T01:23:45.863
11887
333
[ "regression", "intercept" ]
11065
2
null
11064
16
null
If for some reason you know the intercept (particularly if it is zero), you can avoid wasting the variance in your data for estimating something you already know, and have more confidence in the values you do have to estimate. A somewhat oversimplified example is if you already know (from domain knowledge) that one var...
null
CC BY-SA 3.0
null
2011-05-20T22:30:41.580
2011-05-20T22:30:41.580
null
null
4257
null
11066
1
11067
null
0
10575
I'm estimating a GLM with a bunch of parameters in R. When I run this: ``` M <- glm( Y ~ factor(X1) + factor(X2) ) summary(M) ``` R only gives me part of the table, then cuts out with the message: ``` [ reached getOption("max.print") -- omitted 621 rows ]] ``` The summary table will be big, but I want the whol...
How do I change the max.print option in R's summary?
CC BY-SA 3.0
null
2011-05-20T22:31:13.453
2011-05-21T06:14:51.543
2011-05-20T22:46:20.803
4110
4110
[ "r", "generalized-linear-model", "descriptive-statistics" ]
11067
2
null
11066
2
null
I just googled "R getOption("max.print")", and found: `options(max.print=5.5E5)`...
null
CC BY-SA 3.0
null
2011-05-20T22:38:56.957
2011-05-20T22:38:56.957
null
null
4257
null
11068
2
null
11064
14
null
Consider the case of a 3-level categorical covariate. If one has an intercept, that would require 2 indicator variables. Using the usual coding for indicator variables, the coefficient for either indicator variable is the mean difference compared to the reference group. By suppressing the intercept, you would have 3...
null
CC BY-SA 3.0
null
2011-05-20T23:48:34.010
2011-05-20T23:48:34.010
null
null
2312
null
11070
1
null
null
11
754
The "Linear Ballistic Accumulator" model (LBA) is a rather successful model for human behaviour in speeded simple decision tasks. [Donkin et al](http://www.ncbi.nlm.nih.gov/pubmed/19897817) (2009, [PDF](http://mypage.iu.edu/~cdonkin/pubs/brm09b.pdf)) provide code that permits estimating the parameters of the model give...
Modifying linear ballistic accumulator (LBA) simulation in R
CC BY-SA 3.0
null
2011-05-21T03:05:59.953
2012-07-05T08:40:06.213
2012-04-06T07:39:37.327
1766
364
[ "r", "stochastic-processes" ]
11072
1
null
null
1
449
This is perhaps basic but I couldn't find a suitable reference. I have a regression model with a rather complicated link function. So $\vec{x}$ is a vector of continuous predictors, and $z$ is a binary variable such that according to the model: $Pr(z=1) = f(\vec{x})$ for some (known) function $f$. I observe data o...
Goodness of fit for a regression with multiple predictors
CC BY-SA 3.0
null
2011-05-21T03:22:11.233
2011-05-26T18:25:22.063
2011-05-21T05:25:53.687
3036
3036
[ "regression", "goodness-of-fit" ]
11073
2
null
11039
1
null
You originally asked this in reference to R (on stackoverflow), so I'll answer with reference to R. I'm not sure exactly what your goal is, but I'd guess that you want to estimate a panel data model. In that context, you have an "unbalanced panel" and if you want to stick with R, I'd recommend the package plm. The ...
null
CC BY-SA 3.0
null
2011-05-21T04:29:57.587
2011-05-21T05:08:42.717
2011-05-21T05:08:42.717
4699
4699
null
11074
2
null
11066
3
null
You may want to use `sink`. This will divert output to a file, which then you can inspect. ``` sink(file="output.txt") summary(M) sink(NULL) ``` The error you get in your code is because the second argument of function `summary.glm` is `dispersion`, which according to help page should be either numeric or NULL. You s...
null
CC BY-SA 3.0
null
2011-05-21T06:14:51.543
2011-05-21T06:14:51.543
null
null
2116
null
11076
2
null
11064
3
null
To illustrate @Nick Sabbe's point with a specific example. I once saw a researcher present a model of the age of a tree as a function of its width. It can be assumed that when the tree is at age zero, it effectively has a width of zero. Thus, an intercept is not required.
null
CC BY-SA 3.0
null
2011-05-21T06:57:45.463
2011-05-21T06:57:45.463
null
null
183
null
11077
2
null
10167
4
null
The following are just a few points: - If you have departure from normality then bootstrapping is often a good idea. - You mention using "1000" replicates. Increasing the number of replicates increases computational time and accuracy. Thus, sometimes when first setting up your model, you'll set the number of replica...
null
CC BY-SA 3.0
null
2011-05-21T07:31:43.063
2011-05-21T07:54:27.303
2011-05-21T07:54:27.303
183
183
null
11078
2
null
11032
7
null
Baum-Welch is an optimization algorithm for computing the maximum-likelihood estimator. For hidden Markov models the likelihood surface may be quite ugly, and it is certainly not concave. With good starting points the algorithm may converge faster and towards the MLE. If you already know the transition probabilities a...
null
CC BY-SA 3.0
null
2011-05-21T08:51:14.170
2011-05-21T08:51:14.170
null
null
4376
null
11079
1
null
null
4
30625
I need an help because I don´t know if the command for the ANOVA analysis I am performing in R is correct. Indeed using the function aov I get the following error: `In aov (......) Error() model is singular` The structure of my table is the following: subject, stimulus, condition, sex, response Example: ``` subject s...
Problem with ANOVA repeated measures: "Error() model is singular"
CC BY-SA 3.0
null
2011-05-21T12:24:06.390
2017-02-28T01:46:26.293
2011-05-28T20:12:23.450
919
4701
[ "r", "anova", "mixed-model" ]
11080
2
null
11009
68
null
In my experience, not only is it necessary to have all lower order effects in the model when they are connected to higher order effects, but it is also important to properly model (e.g., allowing to be nonlinear) main effects that are seemingly unrelated to the factors in the interactions of interest. That's because i...
null
CC BY-SA 3.0
null
2011-05-21T12:31:20.447
2017-01-01T23:12:33.313
2017-01-01T23:12:33.313
11887
4253
null
11081
2
null
11009
7
null
I would suggest it is simply a special case of model uncertainty. From a Bayesian perspective, you simply treat this in exactly the same way you would treat any other kind of uncertainty, by either: - Calculating its probability, if it is the object of interest - Integrating or averaging it out, if it is not of inte...
null
CC BY-SA 3.0
null
2011-05-21T14:49:49.257
2013-01-09T21:03:55.810
2013-01-09T21:03:55.810
17230
2392
null
11083
2
null
3814
16
null
Using causal language to describe associations in observational data when omitted variables are almost certainly a serious concern.
null
CC BY-SA 3.0
null
2011-05-21T16:04:11.060
2011-05-21T16:04:11.060
null
null
3748
null
11084
1
11086
null
16
3947
I've received a results from a Mann-Whitney rank test that I don't understand. The median of the 2 populations is identical (6.9). The uppper and lower quantiles of each population are: - 6.64 & 7.2 - 6.60 & 7.1 The p-value resulting from the test comparing these populations is 0.007. How can these populations be ...
Why is the Mann–Whitney U test significant when the medians are equal?
CC BY-SA 3.0
null
2011-05-21T16:36:36.803
2020-01-20T20:30:16.293
2011-05-21T18:43:02.763
307
4238
[ "nonparametric", "median", "ranks", "wilcoxon-mann-whitney-test" ]
11085
1
null
null
4
6449
I have conducted a search for genetic interactions using a simple dosage model: Y ~ A + B + AB where Y is the phenotype, in this case, gene expression values and A and B are vectors of genotype information for ~500 samples. I wish to determine a signficance threshold using permutation testing in order to correct for mu...
False discovery rate from permutation testing?
CC BY-SA 3.0
null
2011-05-21T16:39:00.437
2016-03-01T20:53:25.667
2011-05-21T17:01:38.293
930
2842
[ "genetics", "permutation-test", "multiple-comparisons" ]
11086
2
null
11084
11
null
[FAQ: Why is the Mann-Whitney significant when the medians are equal?](https://stats.idre.ucla.edu/other/mult-pkg/faq/general/faq-why-is-the-mann-whitney-significant-when-the-medians-are-equal/)
null
CC BY-SA 4.0
null
2011-05-21T16:50:26.763
2020-01-20T20:30:16.293
2020-01-20T20:30:16.293
25
307
null
11087
1
11089
null
56
20474
I was just wondering why regression problems are called "regression" problems. What is the story behind the name? > One definition for regression: "Relapse to a less perfect or developed state."
Why are regression problems called "regression" problems?
CC BY-SA 3.0
null
2011-05-21T18:25:00.283
2021-02-03T23:07:19.587
2016-01-29T11:23:55.950
28666
3541
[ "regression", "terminology", "history", "etymology" ]
11088
1
11092
null
6
9068
I am a newbie in stat. I am completing my thesis in [Evolutionary algorithm](http://en.wikipedia.org/wiki/Evolutionary_algorithm). I have to generate some random numbers from [T-distribution](http://en.wikipedia.org/wiki/Student%27s_t-distribution) or [Laplace distribution](http://en.wikipedia.org/wiki/Laplace_distribu...
Random number generation using t-distribution or laplace distribution
CC BY-SA 4.0
0
2011-05-21T18:53:13.727
2018-10-19T21:40:48.917
2018-10-19T21:40:48.917
11887
4319
[ "distributions", "matlab", "random-generation", "t-distribution", "laplace-distribution" ]
11089
2
null
11087
42
null
The term "regression" was used by Francis Galton in his 1886 paper "Regression towards mediocrity in hereditary stature". To my knowledge he only used the term in the context of [regression toward the mean](http://en.wikipedia.org/wiki/Regression_toward_the_mean). The term was then adopted by others to get more or less...
null
CC BY-SA 3.0
null
2011-05-21T18:54:18.390
2011-05-21T18:54:18.390
null
null
4376
null
11090
2
null
11088
6
null
Easy answer: Use R and get `n` variables for a $t$-distribution with `df` degrees of freedom by `rt(n, df)`. If you don't use R, maybe you can write what language you use, and others may be able to tell precisely what to do. If you don't use R or another language with a built in random number generator for the $t$-dis...
null
CC BY-SA 3.0
null
2011-05-21T19:05:29.677
2011-05-21T19:05:29.677
null
null
4376
null
11091
1
11094
null
8
327
I believe that independent variables $X_1,X_2$ affect the dependent variable $Y$ through a latent variable $Z$ such that $$ \begin{align} Y &= \beta_0 + \beta_1Z \\ Z &= \operatorname{Logit}^{-1}(\beta_2X_1 + \beta_3X_2) \\ \\ Y &= \beta_0 + \beta_1\operatorname{Logit}^{-1}(\beta_2X_1 + \beta_3X_2) \end{align} ...
Estimating effect of latent variable in regression
CC BY-SA 3.0
null
2011-05-21T19:13:02.953
2017-08-16T15:34:29.873
2017-08-16T15:34:29.873
28666
82
[ "nonlinear-regression" ]
11092
2
null
11088
9
null
Here's how to do this in Matlab using [TINV](http://www.mathworks.com/help/toolbox/stats/tinv.html) from that statistics toolbox: ``` %# choose the degree of freedom df = 4; %# note you can also choose an array of df's if necessary %# create a vector of 100,000 uniformly distributed random varibles uni = rand(100000,1...
null
CC BY-SA 3.0
null
2011-05-21T20:47:23.670
2011-05-22T17:35:16.307
2011-05-22T17:35:16.307
198
198
null
11093
1
null
null
5
8305
Apologies for what is probably a very basic question. I have looked around both here and in the usual places and haven't had any luck. I have read that there are at least two methods for linearly transforming data so that you can give your distribution a certain desired standard deviation. What are they and are there c...
Rescaling for desired standard deviation
CC BY-SA 3.0
null
2011-05-21T21:07:11.437
2011-05-21T22:38:27.183
null
null
52
[ "data-transformation", "standard-deviation" ]
11094
2
null
11091
8
null
One answer is "no." Another is, "of course." ### No To simplify notation, let $\lambda(x) = 1/(1 + \exp(-x))$, the inverse logit. Because $\lambda(x) = 1 - \lambda(-x)$, $$\beta_0 + \beta_1 \lambda(x) = (\beta_0 + \beta_1) - \beta_1 \lambda(-x)).$$ Therefore it is impossible to distinguish the parameters $(\beta_0...
null
CC BY-SA 3.0
null
2011-05-21T21:19:28.657
2011-05-21T21:19:28.657
2020-06-11T14:32:37.003
-1
919
null
11095
2
null
11093
5
null
The SD is directly proportional to the data. Therefore, to change it from 10 to 15 = 1.5 * 10, multiply all scores by 1.5. The other way is to multiply all scores by -1.5, because negating all values does not change the SD. Of course you can also add an arbitrary constant to all the scores, too, without changing the...
null
CC BY-SA 3.0
null
2011-05-21T21:30:00.263
2011-05-21T21:30:00.263
null
null
919
null
11096
1
null
null
82
100634
How can I interpret the main effects (coefficients for dummy-coded factor) in a Poisson regression? Assume the following example: ``` treatment <- factor(rep(c(1, 2), c(43, 41)), levels = c(1, 2), labels = c("placebo", "treated")) improved <- factor(rep(c(1, 2, ...
How to interpret coefficients in a Poisson regression?
CC BY-SA 3.0
null
2011-05-21T15:10:15.500
2023-05-30T17:18:54.797
2017-05-11T19:59:05.170
7290
null
[ "r", "generalized-linear-model", "interpretation", "poisson-distribution", "regression-coefficients" ]
11097
2
null
11096
71
null
The exponentiated `numberofdrugs` coefficient is the multiplicative term to use for the goal of calculating the estimated `healthvalue` when `numberofdrugs` increases by 1 unit. In the case of categorical (factor) variables, the exponentiated coefficient is the multiplicative term relative to the base (first factor) le...
null
CC BY-SA 4.0
null
2011-05-21T15:28:42.660
2023-05-30T17:18:54.797
2023-05-30T17:18:54.797
2129
2129
null
11098
2
null
11079
2
null
Clearly sex is a between condition. You've stated below in the comments that stimulus is within subjects and condition is as well. You are only supposed to put your within conditions in the error term. So, ... ``` aov(response ~ stimulus * sex * condition + Error(subject/(stimulus * condition)) ``` Or, if as you've ...
null
CC BY-SA 3.0
null
2011-05-21T21:47:32.110
2011-05-22T21:37:31.003
2011-05-22T21:37:31.003
601
601
null
11099
2
null
11093
5
null
If you have a random variable (or observed data) $X$ with mean $\mu_x$ and standard deviation $\sigma_x$, and then apply any linear transformation $$Y=a+bX$$ then you will find the mean of $Y$ is $$\mu_y = a + b \mu_x$$ and the standard deviation of $Y$ is $$\sigma_y = |b|\; \sigma_x.$$ So for example, as whuber says, ...
null
CC BY-SA 3.0
null
2011-05-21T22:38:27.183
2011-05-21T22:38:27.183
null
null
2958
null
11100
2
null
11079
4
null
Assuming your design is the following: - sex is a between-subjects IV (with two levels) - stimulus is a within-subjects IV (with 3 assumed levels) - condition is a within-subjects IV (with 2 levels) - all IVs are fully crossed Then this is what you can do to run the full analysis, or to just test for a main effec...
null
CC BY-SA 3.0
null
2011-05-21T23:33:03.443
2011-05-21T23:57:52.530
2011-05-21T23:57:52.530
1909
1909
null
11101
1
null
null
3
873
I was trying to do a test of reliability for my survey items. In addition to Cronbach's alpha I'm looking at communalities. My criteria is that survey items with communality below 0.4 will be dropped. But when I looked at my communality table, I saw that some items had .99 for communality. Is this problematic? What sho...
Implications of communalities close to 1.00 for reliability analysis and survey design
CC BY-SA 3.0
null
2011-05-22T02:36:46.997
2011-05-23T15:54:10.807
2011-05-23T01:43:04.013
183
4702
[ "factor-analysis", "reliability" ]
11102
1
11103
null
7
5509
I'm having trouble performing factor analysis on my dataset. When I perform the factor analysis in SPSS (default settings), it works fine. Problem is, I need to do it programmatically (in Python). When I try using Python (MDP library) to do factor analysis on the same dataset, I get this error: "The covariance matrix...
Factor analysis problem -- singular covariance matrix?
CC BY-SA 3.0
null
2011-05-22T03:56:56.093
2011-05-23T00:13:58.417
2011-05-23T00:13:58.417
1977
1977
[ "spss", "factor-analysis", "python" ]
11103
2
null
11102
6
null
Yes, the two errors amount to the same thing. They're telling you (roughly) that two or more of your manifest variables are linearly dependent (like $y_1 = ay_2 + b$ for scalars $a, b$). These two variables (dimensions) would be "redundant", meaning that the sample covariance matrix is not invertible (ie is singular) a...
null
CC BY-SA 3.0
null
2011-05-22T04:08:51.723
2011-05-22T04:08:51.723
null
null
26
null
11104
2
null
1995
6
null
Multi-level modelling is appropriate, as the name suggests, when your data have influences occurring at different levels (individual, over time, over domains, etc). Single level modeling assumes everything is occurring at the lowest level. Another thing that a multi-level model does is to introduce correlations among...
null
CC BY-SA 3.0
null
2011-05-22T04:40:26.447
2011-05-22T04:40:26.447
null
null
2392
null
11105
1
null
null
0
1836
I am a newbie in stat. I am completing my thesis in [Evolutionary algorithm](http://en.wikipedia.org/wiki/Evolutionary_algorithm). I have to generate some random numbers from [Laplace distribution](http://en.wikipedia.org/wiki/Laplace_distribution). How can I do this using matlab? An easy and simple explanation would b...
Random number generation using laplace distribution
CC BY-SA 3.0
0
2011-05-22T05:11:51.350
2011-05-22T06:22:48.647
null
null
4319
[ "distributions", "matlab", "random-generation" ]
11106
2
null
11088
2
null
You can use the same approach that was described in response to your question about generating random numbers from a t-distribution. First generate uniformly distributed random numbers from (0,1) and then apply the inverse cumulative distribution function of the Laplace distribution, which is given in the Wikipedia ar...
null
CC BY-SA 3.0
null
2011-05-22T06:22:48.647
2011-05-22T06:22:48.647
null
null
3835
null
11107
1
null
null
2
4555
I need to do a logistic regression using R on my data. My response variable (`y`) is survival at weaning (`surv=0`; did not `surv=1`) and I have several independent variables which are binary and categoricals in nature. I am following some examples on this website [http://www.ats.ucla.edu/stat/r/dae/logit.htm](http://w...
Doing logistic regression using R
CC BY-SA 3.0
null
2011-05-22T07:14:51.037
2012-12-12T18:28:05.403
2012-12-12T18:18:39.480
7290
4263
[ "r", "logistic", "interpretation" ]
11108
1
null
null
6
2491
Take a look at this photo: ![data](https://i.stack.imgur.com/J93c2.png) It depicts a [box plot](http://en.wikipedia.org/wiki/Box_plot) of series of identical runs for successive i values. (AFAIK it's the standard Min/Max and 1rst, 2nd, 3rd quartiles.) So the x-axis of 1 represents 1000 runs where i=1; and the second p...
Automatically detecting sudden change of mean
CC BY-SA 3.0
null
2011-05-21T22:15:36.050
2013-07-29T14:14:46.560
2011-05-22T15:40:30.043
919
4703
[ "time-series", "python", "change-point" ]
11109
1
11110
null
205
221921
If you have a variable which perfectly separates zeroes and ones in target variable, R will yield the following "perfect or quasi perfect separation" warning message: ``` Warning message: glm.fit: fitted probabilities numerically 0 or 1 occurred ``` We still get the model but the coefficient estimates are inflated. ...
How to deal with perfect separation in logistic regression?
CC BY-SA 3.0
null
2011-05-22T10:37:08.303
2022-08-27T17:39:21.800
2022-08-27T17:39:21.800
11887
333
[ "r", "regression", "logistic", "separation", "faq" ]
11110
2
null
11109
130
null
A solution to this is to utilize a form of penalized regression. In fact, this is the original reason some of the penalized regression forms were developed (although they turned out to have other interesting properties. Install and load package glmnet in R and you're mostly ready to go. One of the less user-friendly as...
null
CC BY-SA 3.0
null
2011-05-22T11:14:19.717
2013-11-04T15:52:42.270
2013-11-04T15:52:42.270
17230
4257
null
11112
1
null
null
5
2409
I have some data acquired by an acoustic sensor with 1 Hz sampling rate. Due to some inevitable issues, I have some noise in my signal, saying 10% pollution. I'm looking for a reliable method for replacing the outliers. In order to find a suitable approach I manipulated a clean record such that it contains 9% spurious ...
What is the best way to compare fluctuations of two signals?
CC BY-SA 3.0
0
2011-05-22T14:03:41.867
2011-05-26T02:51:52.030
2011-05-26T02:51:52.030
4286
4286
[ "correlation", "autocorrelation", "signal-processing", "covariance-matrix" ]
11113
1
null
null
4
1372
I am using ANOVA with repeated measures to test significance between males and females results of an experiment during which participants had to evaluate 7 stimuli in 2 conditions (EXP1 and EXP2). The problem is that even if from results it is clear that there are significant differences between males and females, I do...
Wrong results using ANOVA with repeated measures
CC BY-SA 3.0
null
2011-05-22T14:20:49.473
2012-02-13T19:14:33.003
2011-05-22T14:51:56.993
2116
4701
[ "r", "anova", "repeated-measures" ]
11114
2
null
11009
13
null
this is implicit in many of answers others have given but the simple point is that models w/ a product term but w/ & w/o the moderator & predictor are just different models. Figure out what each means given the process you are modeling and whether a model w/o the moderator & predictor makes more sense given your theory...
null
CC BY-SA 3.0
null
2011-05-22T14:26:28.640
2011-05-22T14:26:28.640
null
null
11954
null
11115
1
null
null
2
13711
Does anybody know how to plot all AIC values for different size models, when using the command `regsubsets` from the package `leaps`? Assume you have the following variables: ``` treatment <- factor(rep(c(1, 2), c(43, 41)), levels = c(1, 2),labels = c("placebo", "treated")) improved <- factor(rep(c(1, 2, 3, 1, 2, 3), ...
How to plot AIC values when using the leaps package?
CC BY-SA 3.0
null
2011-05-22T14:33:20.660
2016-06-15T09:57:40.210
2011-05-22T17:14:58.163
930
4496
[ "r", "aic", "stepwise-regression", "validation", "bic" ]
11116
2
null
11107
5
null
The lrm function in the R rms package is devoted to binary and ordinal logistic regression, and my help, once you understand the rms documentation. Detailed case studies using rms may be found in course notes at [http://biostat.mc.vanderbilt.edu/rms](http://biostat.mc.vanderbilt.edu/rms). However there are more impor...
null
CC BY-SA 3.0
null
2011-05-22T14:44:36.060
2011-05-22T14:44:36.060
null
null
4253
null
11117
2
null
11115
6
null
The relevant excerpt from the `regsubsets` help pages is the following: > Since this function returns separate best models of all sizes up to nvmax and since different model selection criteria such as AIC, BIC, CIC, DIC, ... differ only in how models of different sizes are compared, the results do not depe...
null
CC BY-SA 3.0
null
2011-05-22T15:04:26.447
2011-05-22T15:04:26.447
null
null
2116
null
11118
1
11119
null
6
381
Given a data frame in R is there a way to export it in R syntax such that executing this code would re-create the data frame? I would find this useful to store results in R files along with calculations without depending on external files.
How to export data in R syntax?
CC BY-SA 3.0
null
2011-05-22T16:37:29.693
2011-06-03T22:30:59.033
2011-06-03T22:30:59.033
930
4195
[ "r" ]
11119
2
null
11118
8
null
You can use `dput()` to get a `structure()` that can be used later. ``` > #Build the original data frame > x <- seq(1, 10, 1) > y <- seq(10, 100, 10) > df <- data.frame(x=x, y=y) > df x y 1 1 10 2 2 20 3 3 30 4 4 40 5 5 50 6 6 60 7 7 70 8 8 80 9 9 90 10 10 100 > #Use the dput...
null
CC BY-SA 3.0
null
2011-05-22T17:06:59.327
2011-05-22T17:06:59.327
null
null
2775
null
11120
1
11128
null
12
9955
I have 5 emerging market foreign exchange total return series, for which I am forecasting single period future returns (1 year). I would like to construct a Markowitz mean variance optimized portfolio of the 5 series, using historical variances and covariances (1) and my own forecast expected returns. Does R have an (e...
Markowitz portfolio mean variance optimization in R
CC BY-SA 3.0
null
2011-05-22T17:21:46.187
2012-12-06T16:54:26.557
null
null
4705
[ "r" ]
11121
2
null
11108
1
null
If I understand you you correctly, you might need to learn about multiple comparisons: [http://en.wikipedia.org/wiki/Multiple_comparisons](http://en.wikipedia.org/wiki/Multiple_comparisons) The choice of a particular procedure is a different question, e.g., Scheffe vs. Tukey vs. Bonferroni. At least in this framework, ...
null
CC BY-SA 3.0
null
2011-05-22T18:00:54.037
2013-07-29T08:59:09.597
2013-07-29T08:59:09.597
22047
4617
null
11122
2
null
11107
10
null
I think you're confused because you defined survival at weaning as surv=0 rather than surv=1. In your model, negative coefficients indicate high odds of survival (low odds of surv=1).
null
CC BY-SA 3.0
null
2011-05-22T18:05:50.277
2011-05-24T15:46:47.447
2011-05-24T15:46:47.447
3874
3874
null
11123
1
null
null
3
590
I've been using R to run GLMs with the logit link to compare clutch sizes (a binomial data set) and proportional data among several years. I now need to compare 2 groups of years (good years and poor years) between 2 sites for the same data. I am not interested in any interactions between year-type (good or poor) and s...
GLM for comparing 2 populations with binomial data?
CC BY-SA 4.0
null
2011-05-22T18:09:43.557
2022-12-16T17:45:04.453
2022-12-16T17:45:04.453
11887
4238
[ "r", "generalized-linear-model", "binomial-distribution" ]
11127
1
11132
null
80
77377
I have 2 dependent variables (DVs) each of whose score may be influenced by the set of 7 independent variables (IVs). DVs are continuous, while the set of IVs consists of a mix of continuous and binary coded variables. (In code below continuous variables are written in upper case letters and binary variables in lower c...
Multivariate multiple regression in R
CC BY-SA 3.0
null
2011-05-22T18:33:57.020
2020-05-05T11:18:56.240
null
null
609
[ "r", "multivariate-analysis", "manova", "multiple-regression", "multivariate-regression" ]
11128
2
null
11120
12
null
You might look at the following: [http://cran.r-project.org/web/packages/tawny/index.html](http://cran.r-project.org/web/packages/tawny/index.html) [http://www.rinfinance.com/RinFinance2009/presentations/yollin_slides.pdf](http://www.rinfinance.com/RinFinance2009/presentations/yollin_slides.pdf) [http://nurometic.com/q...
null
CC BY-SA 3.0
null
2011-05-22T18:59:54.430
2011-05-22T18:59:54.430
null
null
2775
null
11129
2
null
11049
1
null
Dealing with missing observation is a never ending problem. There are a few approaches i will mention, but I am sure others will add more. - Make sure there is no any problems in recording the data, such as systematic omitting certain values. Given you have no control for it, then other options need to be considered. ...
null
CC BY-SA 3.0
null
2011-05-22T19:06:50.440
2011-05-22T19:06:50.440
null
null
4617
null
11130
2
null
10949
1
null
Sara, to understand the difference in the two models is to ask you what question you are trying to find an answer to: - What is the health care expenditure of those who have it? - What is the impact on having health insurance on health care expenditure? To answer the first question, you have a subsample (as you r...
null
CC BY-SA 3.0
null
2011-05-22T19:19:30.557
2011-05-22T19:19:30.557
null
null
4617
null
11131
1
null
null
13
3890
I am wondering if there is a sample size formula like Lehr's formula that applies to an F-test? Lehr's formula for t-tests is $n = 16 / \Delta^2$, where $\Delta$ is the effect size (e.g. $\Delta = (\mu_1 - \mu_2) / \sigma$). This can be generalized to $n = c / \Delta^2$ where $c$ is a constant that depends on the type ...
Sample size formula for an F-test?
CC BY-SA 3.0
null
2011-05-22T19:34:27.523
2018-08-23T16:00:06.400
2013-06-20T07:05:30.763
805
795
[ "sample-size", "statistical-power", "non-central", "f-test" ]
11132
2
null
11127
88
null
Briefly stated, this is because base-R's `manova(lm())` uses sequential model comparisons for so-called Type I sum of squares, whereas `car`'s `Manova()` by default uses model comparisons for Type II sum of squares. I assume you're familiar with the model-comparison approach to ANOVA or regression analysis. This approa...
null
CC BY-SA 3.0
null
2011-05-22T19:42:34.220
2015-12-13T02:39:13.693
2015-12-13T02:39:13.693
null
1909
null
11133
2
null
10890
13
null
The terms endogeneity and unobserved heterogeneity often refer to the same thing but usage varies somewhat, even within economics, the discipline I most associate with the terms. In a regression equation, an explanatory variable is [endogenous](http://en.wikipedia.org/wiki/Endogeneity) if it is correlated with the er...
null
CC BY-SA 3.0
null
2011-05-22T19:44:47.340
2011-05-22T19:44:47.340
null
null
3748
null
11134
1
11140
null
4
1755
I was playing around with writing a code for Montecarlo integration of a function defined in spherical coordinates. As a first simple rapid test I decided to write a test code to obtain the solid angle under an angle $\theta_m$. For two random number $u$ and $v$ in $[0,1)$. I generate a homogeneous random sampling of ...
Monte carlo integration in spherical coordinates
CC BY-SA 3.0
null
2011-05-22T20:31:12.243
2011-05-23T06:19:34.313
2011-05-23T06:19:34.313
2116
4706
[ "sampling", "monte-carlo", "integral" ]
11135
1
null
null
5
2916
I am doing a meta analysis for the first time and have a few basic questions regarding statistical analysis. Let's say I have one study where the primary outcome (thrombosis) in the 2 treatment groups (intervention v. placebo) was compared using the Mantel-Haenszel chi-square test. It does not report df in the articl...
How to extract data from published articles (RCTs) to do a meta-analysis?
CC BY-SA 3.0
null
2011-05-22T21:16:30.673
2012-03-22T14:57:44.067
2011-05-23T01:31:35.270
183
4707
[ "meta-analysis", "clinical-trials" ]
11136
1
null
null
5
979
### Context I have a multivariate dataset with a test group and three control groups. I was thinking that the best way to determine if and how the test group differed from all of the control groups would be to perform a MANOVA, then perform contrast analysis between the test group and all of the control groups. ###...
Tutorial for performing Contrasts for MANOVA
CC BY-SA 3.0
null
2011-05-22T21:59:09.607
2017-04-28T07:45:25.343
2017-04-28T07:45:25.343
28666
3629
[ "manova", "contrasts", "hotelling-t2" ]
11137
2
null
11109
3
null
Be careful with this warning message from R. Take a look at this [blog post](http://www.stat.columbia.edu/~cook/movabletype/archives/2011/05/whassup_with_gl.html) by Andrew Gelman, and you will see that it is not always a problem of perfect separation, but sometimes a bug with `glm`. It seems that if the starting value...
null
CC BY-SA 3.0
null
2011-05-23T00:00:20.187
2013-09-01T17:26:14.537
2013-09-01T17:26:14.537
17230
3058
null
11138
1
null
null
3
3630
Given an hierarchical clustering of data points, some of which are labeled, are there good ways to use the tree/dendrogram to make predictions for the unlabeled points? One approach might be to find the "best" place to cut the tree so that clusters match labels. I'd be especially interested in efficient ways to cut eac...
Using hierarchical clustering to classify?
CC BY-SA 3.0
null
2011-05-23T00:40:54.910
2011-06-22T19:02:45.040
2011-05-23T01:28:43.287
183
4711
[ "clustering", "classification" ]
11139
2
null
10003
8
null
As long as the sponsors of the site are committed to keeping the site running, it would be premature to declare it 'dead.' It is not out of the question that StatProb.com may experience a revival in the future. In judging the longevity of a resource like StatProb.com, the short-term trends are irrelevant. Instead, t...
null
CC BY-SA 3.0
null
2011-05-23T01:11:57.523
2011-05-23T02:51:24.220
2011-05-23T02:51:24.220
3567
3567
null
11140
2
null
11134
5
null
Your calculations are correct and you should get the right Monte Carlo estimate from your formula $4\pi M/N$ with the mapping $(u,v)\to(\phi,\theta)$ you presented. So I would guess it's an error in your code and not in your reasoning. You shouldn't need the cosine weighting factor. Perhaps if you show your code we can...
null
CC BY-SA 3.0
null
2011-05-23T01:15:42.030
2011-05-23T01:15:42.030
null
null
4360
null
11141
1
11144
null
7
3877
I know I'm asking a lot of questions these days! Sorry about that, but I'm trying to work through my grad thesis data collected over the last 4 years, and am repeatedly tripping on my beginner's grasp on stats. The background: My basic question is the same as described in [another question on this site](https://stats.s...
Rank transformed 2-way ANOVA
CC BY-SA 3.0
null
2011-05-23T01:59:04.253
2011-05-23T16:51:00.203
2017-04-13T12:44:45.783
-1
4238
[ "anova", "continuous-data", "ordinal-data", "ranks" ]
11142
1
16676
null
25
3509
I participate in predictive modeling competitions on [Kaggle](http://www.kaggle.com/), [TunedIt](http://tunedit.org/), and [CrowdAnalytix](http://www.crowdanalytix.com/). I find that these sites are a good way to "work-out" for statistics/machine learning. - Are there any other sites I should know about? - How do y...
Sites for predictive modeling competitions
CC BY-SA 3.0
null
2011-05-23T02:47:10.030
2015-12-11T23:22:27.570
2013-01-31T17:20:41.887
2817
2817
[ "machine-learning", "predictive-models" ]
11144
2
null
11141
11
null
The proportional odds (PO) ordinal logistic model is a generalization of the Wilcoxon and Kruskal-Wallis tests, allowing for covariates, interactions, and anything else you can do in a regression model for a univariate response. A two-way ANOVA on ranks is not based on strong statistical principles. One of many comput...
null
CC BY-SA 3.0
null
2011-05-23T03:42:57.647
2011-05-23T06:21:18.493
2011-05-23T06:21:18.493
2116
4253
null
11145
1
null
null
1
334
Suppose I thought that ingesting greater than 100 mg of chemical X annually noticeably decreased one's weight. Also, I had data (from a "natural" experiment) from 100 people (some male and some female) measuring how much of chemical X they had eaten, and their weights at the time of the experiment. - What is the best...
Determining causality from a natural experiment
CC BY-SA 3.0
null
2011-05-23T03:43:22.740
2011-05-25T01:35:52.533
2011-05-23T07:21:07.450
183
4713
[ "hypothesis-testing" ]
11146
2
null
11145
8
null
By a "natural" experiment you mean that you do not control, by randomization, say, the amount of chemical X that each subject takes. This is also often called an observational study. Do you know the difficulties in drawing conclusions about cause and effect from such data? It's really not a question about statistical ...
null
CC BY-SA 3.0
null
2011-05-23T04:57:46.807
2011-05-23T05:03:41.510
2017-04-13T12:44:29.013
-1
4376
null
11147
2
null
11145
5
null
It sounds like everyone in your sample has ingested X. If your hypothesis is that ingesting X causes you to lose weight, you need a sample of people, some of whom have ingested X and some of whom haven't. If your hypothesis is that the more X you ingest, the more weight you lose, then, of course, it's okay if your en...
null
CC BY-SA 3.0
null
2011-05-23T05:51:29.287
2011-05-23T05:51:29.287
null
null
1977
null
11148
2
null
11142
4
null
Here are some nice datasets: [http://archive.ics.uci.edu/ml/](http://archive.ics.uci.edu/ml/) Update: The question has changed since I gave this answer.
null
CC BY-SA 3.0
null
2011-05-23T06:30:18.670
2011-10-07T18:00:33.420
2011-10-07T18:00:33.420
2860
2860
null