Horje
How to Find p Value from Test Statistic

P-values are widely used in statistics and are important for many hypothesis tests. But how do you find a p-value? The method can vary depending on the specific test, but there’s a general process you can follow. In this article, you’ll learn how to find the p-value, get an overview of the general steps for all hypothesis tests, and see a detailed example of how to calculate a p-value.

Hypothesis tests check if a claim about a population is true. This claim is called the null hypothesis (H0). The alternative hypothesis (Ha) is what you would believe if the null hypothesis is false. Knowing how to find the p-value is crucial in testing because it helps you decide if the null hypothesis is likely true or not.

Understanding p-value and Test Statistic

To understand more about p-value and test statistics read the article added below:

p-Value

The p-value is calculated using the test statistic’s sampling distribution under the null hypothesis, the sample data, and the type of test being conducted (lower-tailed, upper-tailed, or two-sided test).

The p-value for:

  • A lower-tailed test is given by: p-value = P(TS ≤ ts | H0 is true) = cdf(ts)
  • An upper-tailed test is given by: p-value = P(TS ≥ ts | H0 is true) = 1 – cdf(ts)
  • For a two-sided test, assuming the distribution of the test statistic under H0 is symmetric about 0: p-value = 2 * P(TS ≥ |ts| | H0 is true) = 2 * (1 – cdf(|ts|))

where:

  • P is the probability of an event.
  • TS is the test statistic.
  • ts is the observed value of the test statistic calculated from your sample.
  • cdf() is the cumulative distribution function of the distribution of the test statistic (TS) under the null hypothesis.

Test Statistic

A test statistic measures how closely your data matches the distribution predicted by the null hypothesis of the statistical test you’re using.

  • Distribution of data shows how often each observation occurs and can be described by its central tendency and variation around that central tendency. Different statistical tests predict different types of distributions, so it’s important to choose the right test for your hypothesis.
  • Test statistic sums up your observed data into a single number using central tendency, variation, sample size, and the number of predictor variables in your model.

Usually, the test statistic is calculated as the pattern in your data (like the correlation between variables or the difference between groups) divided by the variance in the data (such as the standard deviation).

Test Statistic Example

You are testing the relationship between temperature and flowering date for a type of apple tree. You use long-term data tracking temperature and flowering dates from the past 25 years by randomly sampling 100 trees each year in an experimental field.

  • Null Hypothesis (H0): There is no correlation between temperature and flowering date.
  • Alternative Hypothesis (H1): There is a correlation between temperature and flowering date.

To test this hypothesis, you perform a regression test, which generates a t-value as its test statistic. The t-value compares the observed correlation between these variables to the null hypothesis of zero correlation.

Steps to Find p-value from Test Statistic

Here are steps to help calculate the p-value for a data sample:

Step-1: State Null and Alternative Hypotheses

Start by looking at your data and forming a null and alternative hypothesis. For example, you might hypothesize that the mean “μ” is 10. Thus, the alternative hypothesis is that the mean “μ” is not 10. You can write these as:

H0: μ = 10

H1: μ ≠ 10

In these hypotheses:

  • H0 is the null hypothesis.
  • H1 is the alternative hypothesis.
  • μ is the hypothesized mean.
  • ≠ means does not equal.

Step-2: Use a t-test and its Formula

After setting your hypotheses, calculate the test statistic “t” using your data set. The formula is:

t = (x̄ – μ) / (s / √n)

where,

  • t is the test statistic.
  • x̄ is the sample mean.
  • μ is the hypothesized mean.
  • s is the standard deviation of the sample.
  • n is the sample size.

Standard deviation measures how spread out the data points are in a set. It shows how close a data point is to the mean compared to other data points.

Step-3: Use a t-distribution table to find the p-value

After calculating “t,” find the p-value using a t-distribution table, which you can find online. The table includes significance levels of 0.01, 0.05, and 0.1, which indicate how close the hypothesis is to the data set. To use the table, subtract 1 from your sample size “n.”

For example:

n = 10

10 – 1 = 9

Use this number and your chosen significance level to find the corresponding value in the table.

If you have a one-tailed distribution, this value is your p-value. For a two-tailed distribution, which is more common, multiply this value by two to get your p-value.

Example Calculating p-value

Here’s an example of calculating the p-value based on a known set of data:

Emma wants to know if the average number of hours students study each week is 15 hours. She gathers data from a sample of students and finds that the sample mean is 13 hours, with a standard deviation of 3 hours. She decides to perform a two-tailed t-test to find the p-value at a 0.05 significance level to determine if 15 hours is the true mean. She forms the following hypotheses:

  • H0: μ = 15 hours
  • H1: μ ≠ 15 hours

After forming her hypotheses, she calculates the absolute value, or “|t|,” of the test like this:

  • t = (13 – 15) / (3 / √20)
  • t = (-2) / (0.67082)
  • t = -2.980
  • |t| = 2.980

Using this t-value, she refers to a t-distribution table to locate values based on her significance level of 0.05 and her t-value of 2.980. She uses a sample size of 20 and subtracts 1 to get the degrees of freedom:

  • 20 – 1 = 19

She then reviews her t-value of 2.980, which falls between the levels 0.005 and 0.001 on a t-distribution table. She averages 0.005 and 0.001 to get a value of 0.003. With a two-tailed test, she multiplies this value by 2 to get 0.006, which is the p-value for this test. Since the p-value is less than the 0.05 significance level, she rejects the null hypothesis and accepts the alternative hypothesis that the average number of hours students study each week is not 15 hours.

Using Statistical Software to Find p-value

P-Values can be calculated using p-value tables, spreadsheets, or statistical software like R or SPSS. You can find out how often the test statistic falls under the null hypothesis by using the test statistic and degrees of freedom (number of observations minus the number of independent variables).

The method to calculate a p-value depends on the statistical test you’re using. Different statistical tests have different assumptions and produce different statistics. Choose the test method that best fits your data and the effect or relationship you’re testing. The number of independent variables in your test affects the size of the test statistic needed to produce the same p-value.

No matter what statistical test you use, the p-value always indicates how often you can expect to get a test statistic as extreme or more extreme than the one from your test.

Practical Applications of p-value

P-Value is important in many engineering fields, from electrical engineering to civil engineering. It helps test prototype reliability, validate experiment results, and optimize systems, supporting statistically-informed decisions.

  • Electrical Engineering: Electrical engineers use P-Values to test the efficiency of electrical devices, compare different models’ performance, and validate results from complex circuit simulations.
  • Civil Engineering: In civil engineering, P-Values help validate the strength of construction materials, assess new design methods’ effectiveness, and analyze various structural designs’ safety.

Conclusion

Knowing how to calculate and understand p-values is important for making good decisions based on statistical tests. Whether you’re in electrical engineering, civil engineering, or another field, p-values show you how reliable and significant your data is. By learning the steps to find p-values and using the right statistical tests, you can check your hypotheses and make confident, data-based decisions.

Frequently Asked Questions

How to find p-value from test statistic on calculator?

You can get a p-value by performing an inference test, which can be done by pressing the stat key followed by two clicks to the right. There will be a list of tests, and by putting in your numbers, the calculator will give you a p-value.

How do you find the p-value from the F test statistic?

To find the p values for the f test you need to consult the f table. Use the degrees of freedom given in the ANOVA table (provided as part of the SPSS regression output). To find the p values for the t test you need to use the Df2 i.e. df denominator.

What is the formula for the p-value of the t-test?

p-value = P(T ≥ t∗|T ∼ p0). In other words, the p-value is the probability under H0 of observing a test statistic at least as extreme as what was observed. If the test statistic has a continuous distribution, then under H0 the p-value is uniformly distributed between 0 and 1.

What is the formula for test statistic?

For a z-test, the test statistic is z = x ¯ − μ σ n and for a t-test, the test statistic is t = x ¯ − μ s n , where is the sample mean, is the population mean, is the population standard deviation, is the sample standard deviation, and is the sample size.

How to find the p-value of the test statistic?

The p-value is calculated using the sampling distribution of the test statistic under the null hypothesis, the sample data, and the type of test being done (lower-tailed test, upper-tailed test, or two-sided test). The p-value for: a lower-tailed test is specified by: p-value = P(TS ts | H 0 is true) = cdf(ts)




Reffered: https://www.geeksforgeeks.org


Maths MAQ

Related
How to Multiply Percentages with Decimals How to Multiply Percentages with Decimals
How to Find the Sum of an Arithmetic Sequence How to Find the Sum of an Arithmetic Sequence
What is the SI Unit of Capacitance? What is the SI Unit of Capacitance?
What is the SI Unit of Electric Field? What is the SI Unit of Electric Field?
What is the SI Unit of Mass? What is the SI Unit of Mass?

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
23