New answers tagged

2

1&2) You are working on a prediction problem. You need to solve $$\pi(k\ge450|4\text{ success of 10 tries})=1516927277253024\sum_{k=450}^{1000}\int_0^1\binom{1000}{k}p^k(1-p)^{1000-k}(1-p)^{25}p^{23}\mathrm{d}p$$ That is your posterior probability that the next 1000 tosses will result in 450 or more successes. You should gamble no more than the prize ...


0

A pdf is a pdf. Just as you could integrate the binomial pdf from 450 to 1000 based on 1000 coin flips, you can integrate the Beta(24,26) from p = 0.45 to p = 1, based on your posterior, to get the probability of 450 or more out of 1000. I don't know that there is any single "correct notation" for the probability that you seek. You specified quite nicely in ...


1

A P-value below 0.05 would indicate that the two samples are from different distributions. Your P-value is smaller than 0.05, so you would reject the null hypothesis that the two samples are from the same distribution. A difficulty with the Kolmogorov-Smirnov test, used with large sample sizes, is that small, unimportant differences between two samples are ...


0

The residuals from your model could be used as input to an analysis program that would evaluate 1) significant deviation of the observed values versus the expected values and suggest either pulse, level/step shift or the need for time trend indicators in the presence of possibly auto-correlated residuals 2) whether or not a deterministic error variance ...


1

I don't know if this clears it up, but this is how Conover and Wilcox handle the hypotheses for the Mann-Whitney test. Conover, 1999, Practical Nonparametric Statisitcs, 3rd. Let F(x) and G(x) be the distribution functions corresponding to X and Y, respectively. Then the hypotheses may be stated as follows. H0: F(x)=G(x) for all x. H1: F(x)≠G(x) for ...


2

This is a misunderstanding: In the first link, it is specifically stated "$H_0 :$ The two population distributions are identical" and that point of view is consistently taken throughout. In the second link, @Glen_b says that the test "considers whether" one variable is stochastically greater than the other. That is never said to be the null hypothesis, and ...


0

If the distances are continuous and are not too close to 0 (truncated distribution) then a regular linear model could solve this, by comparing the means of the pupils. You say that the pupils do not get better or worse over time, that each observation is independent. I don't know how this is possible but whatever, I would still include a random effect for ...


2

Here are fake data for Q1 for illustration at the benchmark company (200 responses) and at one of the other companies (352). The p vectors indicate proportions; R turns them into probabilities. The other company is simulated to have more Likert 2s and 3's and fewer Likert 5's than the benchmark company. set.seed(2019) bnchmrk = sample(1:5, 200, rep=T, p=c(1,...


0

I'd argue that this is an ill-posed question. Imagine that there existed a test that would tell you if two samples are "the same", or not. If the samples were the same, this would mean that you'd get the same estimates for the regression parameters, so there would not be any point in joining them, since the only thing that you'd gain are narrower confidence ...


1

The chi-squared test is intuitive, as it deals with 2x2 tables of counts, which is what you will have at the end of your study. However, it doesn't answer the question that you want to ask. Instead, you need a test of the equality of the marginal proportions of the table. That test is McNemar's test. I discuss it here and here. In brief, you are ...


3

Covariate [differences] in Table One are not statistically significant because they are not prespecified hypotheses. And nobody would take you seriously for prespecifying a hypothesis of differences in, say, sex and age when running an RCT. Adjust for covariates in the final model if you are worried about imbalance and the imapct. If the hypothesis is not ...


1

The paper Estimation of the correlation coefficient using the Bayesian Approach and its applications for epidemiologic research provides posterior probability distributions for the linear correlation coefficient, from which you can easily compute the probability that the determination coefficient belongs to any set of interest as required (by numerical ...


0

Some good answers have been already posted, so I will just post a remark here that was important to me some time ago, that aims to be very intuitive and pragmatical. When you have a situation like this, think about the opposite case. You have a sample and you estimate a mean (for example) which turns out to be terribly big. So, at first glance, you would ...


0

Did you try plotting the data in log-log scale? It may be that the small correlation becomes very discernible on a log-log scale. Just remember to add 1 when log-transforming: x -> log(x+1) I don’t think your question here is about whether a small correlation matters - I think you want to know how come your software finds a correlation that you don’t think ...


0

A technical note: you never accept a null hypothesis based on a test. You either reject it, or you fail to reject it. A p-value does not tell you which of two hypotheses (null or alternate) is correct. It tells you the probability of finding a more extreme value assuming that no effect exists (the null hypothesis), conditional on some large and important ...


2

Here’s a key point about the p-value. It does not quantify by how much your null hypothesis is wrong. You could have a very subtle effect that is detected by having many observations. That’s what happened to you. Your data have some slight correlation, but it’s extremely unlikely that it’s due to chance. You’ve detected a real feature of your population, ...


0

The typical setup for a two-sample t-test is: $$X_1,\dots,X_n \overset{iid}\sim N(\mu_x,\sigma^2)$$ $$Y_1,\dots,Y_m \overset{iid}\sim N(\mu_x + \delta,\sigma^2)$$ $$H_0: \delta = 0$$ $$H_a: \delta \ne0 $$ $$\text{(Or do it one-sided.)}$$ By this setup, if you find that there are two different distributions, the only way for that to happen is if they ...


0

I don't know why it was notated like this but what is meant is that you count the elements in the set that fulfills the condition in {}. That is, for $p* = \frac{\Sigma_{j=1}^n I\{\bar{X}^*_j ≥ \bar{X}\}}{B}$ You count, how many $\bar{X}^*_j$ are greater or equal to $\bar{X}$. The typical notation in the statistical literature on bootstraps is: $p* = \...


1

Suppose I have the following $n = 20$ observations sampled at random, as listed and summarized below: x [1] 37.0 38.4 46.2 57.1 40.2 39.0 54.7 54.0 52.5 37.1 [11] 49.6 45.7 43.6 41.1 49.7 56.3 41.8 53.8 48.1 38.3 summary(x) Min. 1st Qu. Median Mean 3rd Qu. Max. 37.00 39.90 45.95 46.21 52.83 57.10 sd(x) [1] 6.919454 I suppose that ...


2

You could use a linear mixed effect model for your data. Perhaps something like this in R: model <- lmer(IOP ~ 1 + Occasion +(1|Subject)+(1|Subject:Eye),data) where Occasion = 0 for Baseline and 1 for Post Baseline. See http://www.maths.bath.ac.uk/~jjf23/mixchange/repeated.html for more ideas.


0

After some research and the help of a comment by @Glen_b I will answer my question. The correct keyword is prediction interval; Wikipedia has this article about the subject. A recent reference is Improved Closed-Form Prediction Intervals for Binomial and Poisson Distributions (Krishnamoorthy & Peng, 2011) [PDF link].


4

Let's parse the notation and then answer your questions. This "critical function" $\phi$ is a tool to make a decision. Given the value $X$ of a test statistic, independently observe a uniformly distributed variable $U$ (supported on $[0,1]$). Reject the null hypothesis when $U \le \phi(X);$ otherwise, do not reject it. To be explicit, given an ...


3

Data. You have $n = 103$ 'grades' with values $v = (55. 60, 65, \dots, 90)$ occurring with respective frequencies $f = (2, 6, 18, 27, 25, 22, 3).$ Treating this as a sample, we use $A =\bar X = \frac 1n \sum_{i=1}^7 f_iv_i,$ where $n = \sum_{i=1}^7 f_i = 103,$ so that the sample mean $A = \bar X = 77.039$ estimates the mean $\mu$ of a population. v = c(60, ...


2

I am not experienced enough to comment on the appropriateness of this technique, but here's help with your code: grades <- rep(seq(55,90,5), c(1,2,6,18,27,25,22,3)) t <- table(grades) my.cdf.vals <- c(rep(0,8),1) my.cdf.vals[2:8] <- pnorm(seq(55,85,5)+2.5, mean(grades), sd(grades)) p <- rep(0,8) for (i in 1:8)...


0

If you want to see if the relationship between (the conditional expectation of) $y$ and $x_0$ is linear, after adjusting for control variables $x_1, x_2, \dots, x_p$, a simple graphical approach is to create an added-variable plot using the following procedure. First, regress $y$ on $x_1, x_2, \dots, x_p$ and obtain the residuals from that regression, $\hat{...


1

My initial reaction is that 0.03 vs. 0.07 is quite a small difference in such a noisy random variable as a p-value - even if we assume the particular dichotomization was pre-specified (it is certainly true that shopping around for the optimal cutpoints dichotomizing will have a lower "p-value" - except that it will be invalid). In any case, power is an ...


1

Related answer here from just yesterday. If the distribution you observe is the distribution you wish to test, then binning forfeits information and will thus on average reduce your ability to (in this case) reject the hypothesis that the distributions are different between the two groups. There are 3 important caveats, though. 1) the tests you use matter. ...


1

Because type II errors are considered to be less of a problem than type I errors. Type I errors have greater implications for future research. Moreover, most of the time, experiments with high power are much more expensive. But of course you can also question both the whole NHST framework and the way it is frequently misused by unaware researchers...


0

This is not a good approach, because it does not consider any interactions between any of the variables, since a t-test is a univariate test, that is checking one variable at a time. That's what more complex models are better at. Regularization would be a better option then multiple t-tests.


1

Just throw them all into a random forest. It's quite fast and robust to noisy predictors.


2

The t test works quite well for many samples that are not exactly normal. You are correct that some care is required in order to use the t test appropriately. However, you seem to be asking the wrong questions about the wrong procedures. I hope the following discussion will help you get onto a more useful track. Moderately large samples. In many ...


0

If each person answers about both questions, McNemar's test is best. Imagine a 2x2 table where the rows are the people who answer Yes/No to X and the columns are the people who answer Yes/No to Y. The table is then... $$ \begin{bmatrix} e & f \\ g & h \end{bmatrix}$$ Here, $e$ people answer yes to both, $h$ people answer no to both, $g$ answer ...


0

This is a quick reply to Alex's answer above. I can't comment because I'm out of credits! I fear you miss the point. I wrote: "such an awful mixture... for a single coin.". I'm definitely not talking about the existence of mixed discrete-continuous distributions, which is obvious. If you mix anything and everything (e.g. your bags of coins), then of ...


1

You can try the McNemar chi squared test and Z test for paired samples. Quoted from the book, the type of situation typically involves measurements made on a variable before and after some sort of intervention.


1

Chi-square is not right here. Chi-square is good when you have a crosstabulation with counts in the cells. You have amount of time. I would look at some form of regression with "time spent" as the dependent variable, and "day of week", "type of activity" and their interaction as independent variables. The interaction answers your question of whether some ...


1

It sounds like the difference is only interesting to you if the difference is in a particular direction, so one-sided testing would be appropriate. If you did two-sided testing, I'm imagining this conversation with your boss. YOU: "...and then after hypothesis testing, I conclude that it was not 75 degrees celcius, and 5% of people did not have a positive ...


2

Contrary to what Fabrice is saying, mixed discrete-continuous distributions are completely fine mathematically. His comment about Lebesgue-negligable sets and the contradiction doesn't really make sense--in first case, the set ${0.5}$ is, of course measure 0 under the measure associated with any continuous random variable. However, changing the distribution ...


-1

Xi’an answer above is plain wrong and insane. If $\theta$ is a continuous parameter, then a basic theorem of measure theory (a singleton has Lebesgue measure $0$, it is said to be Lebesgue-negligible.) tells us that the probability that $\theta$ is equal to any particular value $\theta_0$ (e.g. $\theta_0 = 1/2$) is equal to $0$, a priori and a posteriori. ...


3

Plenty of sttistics teachers, particularly in intro classes (say AP stat), will write $H_0: \mu = 0$ vs $H_a: \mu <0$, but it's really $H_0: \mu \ge 0$ vs $H_a: \mu <0$. The choice of null and alternative hypothesis is exactly that: a choice. A lawmaker may want to know if tax reform caused a decrease in inequality. If the tax reform increased ...


0

That's a perfectly reasonable way to generate hypotheses/ideas/things to investigate. Where things go wrong is, if you then evaluate this hypothesis on the same data, as if you had had this hypothesis before seeing the data (and even worse if one misleads people in this respect and claims that this had been the pre-specified research question). The clean ...


1

Yes, what you describe is a bad idea because it biases the p-values strongly. As always, there's an xkcd for it, or at least an extreme version of it. However, it does happen and it was a factor in many big cases within the replication crisis in social science, including the work of Brian Wansink and Amy Cuddy. As such, it's also been a motivating factor in ...


1

Yes, your test indicates that the mean difference between the two groups is 29.42 and that this difference is significant, with p < 2.2e-16. It does not make sense to ask the question "which rows are significantly different?" because doing a t-test requires multiple points from each group. Comparing just one point from each group is not really meaningful*,...


4

Great thread which generated some great answers - though I have a feeling it will be moved to Stack Exchange because it is software related (the software being R). To supplement Noah's answer, I will show an alternative way one can test the hypotheses of interest using the multcomp package. [Note that we can't test just a null hypothesis - we need to ...


10

If $\beta_1 + \beta_2 = 0$, then $\beta_1 = -\beta_2$, so $\beta_1 x_t + \beta_2 z_t = \beta_1 x_t - \beta_1 z_t = \beta_1 (x_t - z_t)$. So, in R, you can run f1 <- lm(y ~ I(x - z), data = data) f2 <- lm(y ~ x + z, data = data) anova(f1, f2) which will give you a test if the model where $\beta_1 + \beta_2 = 0$ (i.e., f1) fits worse than a model ...


-1

Maybe you can try a Chi-square goodness of fit ( observed -expected) for your data points, for two models, one with $\beta_1= -\beta_2$ and another one where you use $\beta_2 \in (\beta_1 - \epsilon, \beta_1 + \epsilon )$ with your choice of $\epsilon >0 $ a Real number, and check the two Chi-squared statistics using the needed degrees of freedom.


2

The variance of $\beta_1 + \beta_2$ is $\operatorname{Var}(\beta_1) + \operatorname{Var}(\beta_2) + 2\operatorname{Cov}(\beta_1,\beta_2)$. Obtain the variance and covaraince from the covariance matrix and construct an appropriate confidence interval. Here is some R code. I'm sure there is a package to do this, but until someone posts that, this should do ...


2

The case is well-covered in Bayesian textbooks, including ours!, and can be summarised by the constraint that one can only test hypotheses for which the prior has a positive probability mass. When the prior is given as a Uniform(0,1), it is impossible to test whether or not $\theta=1/2$. A contrario, if one comes up with the question as to whether or not $\...


3

Even if you do get a significant p-value from a test of significance, you are supposed to look at the magnitude of the effect by constructing a confidence interval for it. Case 1: When examining the confidence interval, if you notice for example that the interval falls entirely below your predefined threshold for what constitutes a clinically important ...


0

One reason is that alternative hypothesis are not well-formed in that they don't describe a specific state of the world; rather they express the negation of the specific state described in the null hypothesis. For example, in performing an a correlation test between two variables, one typically sets the null hypothesis to be that the population correlation $\...


0

First, the p-value is not the probability of observing the data assuming the null is true, it is the probability of getting a test statistic at least as extreme as the one we got, given that the null is true. Second, for normality, there really aren't good tests for using the NHST, regardless of what we want to do. It's much better to use graphical ...


Top 50 recent answers are included