Questions tagged [hypothesis-test]

Functions used to choose between competing hypotheses about one or more probability distributions. For statistical questions, please use stats.stackexchange.com.

Common hypothesis tests include the one-sample and paired t-test for means, the z-test, which approximates the t-test for large samples, F-test for differences in variance, and Chi-square test for independence, and Fisher's exact test for differences in proportion.

Please note that this tag is totally different from , which refers to software testing.

349 questions
2
votes
1 answer

Wrong P_value given by ttest_1samp

Here is a one sample t-test example: from scipy.stats import ttest_1samp import numpy as np ages = [32., 34., 29., 29., 22., 39., 38., 37.,38, 36, 30, 26, 22, 22.] ages_mean = np.mean(ages) ages_std = np.std(ages,…
LearnToGrow
  • 1,656
  • 6
  • 30
  • 53
2
votes
1 answer

Density plot showing the critical region using hypothesis testing in R?

Assume that sampling from a Normal distribution with known variance, so will employ a z-test (not t-test). mu0 <- 4 ## Null hypothesis mean value stdev <- 3 ## Known population standard deviation signif.level <- 0.05 …
2
votes
1 answer

Hypothesis testing in R

Im currently doing linear regression for data set. I need to test hypothesis H0:B1=0 vs H1:B1=/=0 for significance lvl a = 0.05 and find p-value. I run command summary(lm(y~x~)) and the p-value was 0.02781 However when I tried t.test(x,y) I got…
Worldman
  • 21
  • 1
2
votes
0 answers

Wald/LRT/Score Hypothesis test in R for multinomial model

For multinomial and ordinal models in R via the nnet package and MASS package, respectively, how do I get an LRT, Wald test, and Rao score test for the full model and various groups of coefficients within the model? For example, given the following…
Michael
  • 111
  • 9
2
votes
0 answers

What is the Benjamini-Yekutieli test

According to the documentation the tsfresh algorithm makes use of the Benjamini-Yekutieli in its final step. To give you a little bit of context, tsfresh automatically calculates a large number of time series characteristics, the so called…
user1315621
  • 3,044
  • 9
  • 42
  • 86
2
votes
1 answer

glht function in R giving different results compared to calculations done by hand

I am coding an example and comparing with results obtained by hand however the results are not consistent. The data set is about a study comparing a score for 3 different treatments. The data set can be reproduced as follows (relabelled for…
NM_
  • 1,887
  • 3
  • 12
  • 27
2
votes
1 answer

How to implement a KS-Test in Python

scipy.stats.kstest(rvs, cdf, N) can perform a KS-Test on a dataset rvs. It tests if the dataset follows a propability distribution, whose cdf is specified in the parameters of this method. Consider now a dataset of N=4800 samples. I have performed…
2
votes
1 answer

How to perform (modified) t-test for multiple variables and multiple models

I have created and analyzed around 16 machine learning models using WEKA. Right now, I have a CSV file which shows the models' metrics (such as percent_correct, F-measure, recall, precision, etc.). I am trying to conduct a (modified) student's…
2
votes
1 answer

Conduct a linear hypothesis test on the estimated coefficients of a logistic regression in R

I have the logistic regression of the form where The corresponding R code is the following. Regression_hat<-glm(Y~X,family=binomial(link='logit')) I know that in order to test the joint hypothesis test the linearHypothesis test can be used with…
Whitebeard13
  • 411
  • 1
  • 7
  • 17
2
votes
1 answer

Hypothesis on a proportion in R

I have a random sample of 100 YES/No answers. 13 of them are "YES". The rest are "NO". I have to test a hypotheses on the proportion. Hypothesis: H0: p = p0 H1: p > p0 Confidence level is 95% I have the following code: (The z.prop function…
Dàvid Nagy
  • 159
  • 3
  • 10
2
votes
2 answers

Restriction test (H0: alpha1+beta1 = 1, H1:alpha1 + beta1 ≠ 1) on GARCH model in R not working

I am trying to do the restriction test for GARCH model (ugarch from 'rugarch' package) using the following hypothesis: H0: alpha1 + beta1 = 1 H1: alpha1 + beta1 ≠ 1 So I am trying to follow the advice from…
Eric
  • 528
  • 1
  • 8
  • 26
2
votes
1 answer

Getting wrong p-values for Tukey test for one-way mixed effect ANOVA

I am trying to replicate a textbook example of a Tukey Test for One-Way Mixed Effect ANOVA (from Statistics, William L. Hays p 581-583) but the p-values I am getting using lme & glht don't make sense The study has repeated measures of four…
2
votes
1 answer

Why I always get zero for adfuller test?

constant_all = [38.315546998853549, 40.187217618535399, 43.71380567455396, 45.450748920811293, 50.112269986599735, 59.275158665010736, 65.979556682432815, 106.81142772445702, 122.61124737594076, 160.38976378829483, 109.69662873794118,…
JOHN
  • 1,411
  • 3
  • 21
  • 41
2
votes
1 answer

Using R for lack-of-fit F-test

I learnt how to use R to perform an F-test for a lack of fit of a regression model, where $H_0$: "there is no lack of fit in the regression model". where df_1 is the degrees of freedom for SSLF (lack-of-fit sum of squares) and df_2 is the degrees…
hongsy
  • 1,498
  • 1
  • 27
  • 39
2
votes
0 answers

calculate critical value for The Spearman Rank Correlation Coefficient

i know formula for calculation The Spearman Rank Correlation Coefficient, here is it my question is : how to calculate critical value? i know that T test can work for this case, but for instance for the following data to find critical value…
user466534