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
1
vote
1 answer

R - Using Batlett's test function for each column in a data frame

I have a data frame and I need to apply the bartlett.test() function for each column in it. If possible, I needed to run it with the apply() or sapply() functions. My sample data is like: df <- data.frame(ENSG00000000003 = c(10, 50, 30, 40),…
1
vote
2 answers

changing class and getting numbers

I am working with the golub dataset in R (separated by the AML and ALL) and I am attempting to do a hypothesis test in relation to two genes. For the AML patient group, I want to find out the proportion of patients who have a higher expression of…
hkak
  • 13
  • 3
1
vote
1 answer

T test between two dataframes and grouped by similar rows in R

The title may not be extremely clear but hopefully I can describe it better here. I have two data frames and each one describes monthly spending for different types of customers. For example, for A customers I have a dataframe like year_month …
user2113499
  • 1,001
  • 3
  • 13
  • 23
1
vote
3 answers

How to iteratively compute p-values for t-test

a) Generate 50 values from X ~ N (μX= 25, σX = 4) and 50 values from Y ~ N (μY= 25, σY = 4). Use a t-test to test for equality of the means. c) Repeat part (a) 2500 times, and retain the p-value for each of the 2500 tests. Each repetition should…
1
vote
2 answers

R Continue t.test in a map-function, although there are not enough observations

In my example data I have 3 dataframes. Every df has 2 variables (varA and varB) per threshold. There are 3 thresholds (1, 2, 3): df1 <- tibble( var1A= rnorm(1:10) +1, var1B= rnorm(1:10) +1, var2A= rnorm(1:10) +2, var2B= rnorm(1:10) +2, var3A=…
TobKel
  • 1,293
  • 8
  • 20
1
vote
1 answer

R - Pass column names as Variable with names contain I()

I'm performing the polynomial regression and testing the linear combination of the coefficient. But I'm running to some problems that when I tried to test the linear combination of the coefficient. LnModel_1 <- lm(formula = PROF ~…
1
vote
1 answer

Conduct Multiple T-Tests in R, Condensed

I wish to conduct multiple t-tests in R, without having to go through a copy-paste of each test. Each test will whether differences exist in the "Type" (whether "Left" or "Right") when looking at the "Level_#". Currently, I might…
user6106624
1
vote
1 answer

SUR regression: Testing if means of coefficients are equal to zero or not

I am running a SUR regression with returns of 80 different banks as dependent variables. The independent variables are always the same. You should be able to recreate the regression using the code below, if necessary to answer my questions, which…
Dave13
  • 55
  • 5
1
vote
0 answers

Assessing the significance of change in one parameter between two samples

Let's assume we have two data samples. One of them has an additional parameter. This parameter does not initially exist in that data sample. But after being added, we can see one of other attributes of the sample (e.g. performance percentage) has…
1
vote
1 answer

R Help: F-Statistic regression test holding one variable constant

I am trying to run a number of F tests on a regression to test whether or not elasticity coefficients are statistically different from 0. The regression I am using is shown below, and I am trying to test dem-elasticity of…
Hassan A
  • 337
  • 2
  • 10
1
vote
0 answers

F test between two regression models in R when output is a felm object

Suppose I am using lfe package felm to account for a very large number of fixed effects. Y = b0 + b1*X1 + fixed effects Y = b0 + b1*X1 + b2*X2 + b3*X3 + fixed effects model1 = felm(Y~X1| fixedeffects, data = data) model1 = felm(Y~X1 + X2 + X3|…
wolfsatthedoor
  • 7,163
  • 18
  • 46
  • 90
1
vote
1 answer

understanding durbin-watson test in R

I seem to misunderstand how the dwtest of the lmtest package in R works. > r1 <- runif(1000, 0.0, 1.0) > r2 <- runif(1000, 0.0, 1.0) > dwtest(lm(r2 ~ r1 )) Durbin-Watson test data: lm(r2 ~ r1) DW = 1.9806, p-value = 0.3789 alternative…
BadPractice
  • 13
  • 1
  • 3
1
vote
1 answer

why divide sample standard deviation by sqrt(sample size) when calculating z-score

I have been following Khan Academy videos to gain understanding of hypothesis testing, and I must confess that all my understanding thus far is based on that source. Now, the following videos talk about z-score/hypothesis testing: Hypothesis…
1
vote
0 answers

Can Kruskal-Wallis test be used to test significance of multiple groups within multiple factors?

I have tried to read what I can on Kruskal-Wallis and while I have found some useful information, I still seem to not find the answer to my question. I am trying to use the Kruskal-Wallis test to determine the significance of multiple groups,…
1
vote
1 answer

How to compare two Probability Density Functions?

I have two Probability Density Functions and I want to know if their distributions are similar or not. I know that KS test in R can do this, but when I run the code, an error occurs. Thanks for any help. set.seed(100) a=density(sample(x=1:30,size =…
Yang Yang
  • 858
  • 3
  • 26
  • 49