principles:low_coupling
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| principles:low_coupling [2021-10-18 21:49] – +++ restored +++ christian | principles:low_coupling [2025-11-10 04:32] (current) – created mellissam44 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Low Coupling (LC) ====== | + | How to Calculate P Values: A Clear and Confident Guide |
| + | Calculating p-values is an important part of statistical analysis that helps researchers determine the significance of their results. A p-value is a measure of the probability that an observed difference between groups is due to chance, rather than a true difference in the population. In other words, it tells us whether our results are statistically significant or not. | ||
| - | ===== Variants and Alternative Names ===== | ||
| - | * Loose Coupling | ||
| - | ===== Context ===== | + | To calculate a p-value, researchers need to perform a hypothesis test. This involves comparing the observed data to what would be expected if there were no real difference between groups. If the observed data is significantly different from what would be expected by chance, then the p-value will be low, indicating that the results are statistically significant. On the other hand, if the observed data is not significantly different from what would be expected by chance, then the p-value will be high, indicating that the results are not statistically significant. |
| - | /* fill in contexts here: */ | + | (Image: [[https:// |
| - | * [[contexts:Object-Oriented Design]] | + | [[https:// |
| - | * [[contexts:API Design]] | + | Definition of P Values |
| - | | + | |
| + | P value is a statistical measure that represents the probability of obtaining a result as extreme as, or more extreme than, the observed result under the null hypothesis. The null hypothesis is the default assumption that there is no significant difference between two groups or variables. The P value is used to determine whether the null hypothesis should be rejected or not. | ||
| - | ===== Principle Statement ===== | ||
| - | [[glossary: | + | A P value ranges from 0 to 1, with a smaller P value indicating stronger evidence against the null hypothesis. In general, a P value of 0.05 or less is considered statistically significant, |
| + | Significance in Hypothesis Testing | ||
| - | ===== Description ===== | + | P values play a crucial role in hypothesis testing, which is a method used to determine whether there is enough evidence to reject the null hypothesis. In hypothesis testing, researchers formulate a null hypothesis and an alternative hypothesis, and then collect data to test the hypotheses. |
| - | A module should not interact with too many other modules. Furthermore if a module //A// interacts with another module //B//, this interaction should be loose, which means that //A// should not make too many assumptions about //B//. | ||
| - | Coupling | + | If the P value is less than the significance level (usually set at 0.05), the null hypothesis is rejected, and the alternative hypothesis |
| - | There are different forms of couplings which can be rated according to their strength((G. J. Myers: //Reliable Software through Composite Design//)): | + | P Values in Context |
| - | * //No coupling//: The modules do not know each other. | + | It is important |
| - | * //Call coupling//: A module calls another one. | + | |
| - | * //Data coupling//: A module calls another one passing parameters | + | |
| - | * //Stamp coupling//: A module calls another one passing complex parameters to it. | + | |
| - | * //Control coupling//: A module influences | + | |
| - | * //External coupling//: The modules communicate using a simple global variable. | + | |
| - | * //Common coupling//: The modules communicate using a common global data structure. | + | |
| - | * //Content coupling//: A modules depends on the inner working | + | |
| - | The forms ranging from no coupling to stamp coupling can be considered " | ||
| - | There are also some additional forms of undesirable couplings: | + | Additionally, |
| - | * //Tramp coupling//: A module is only coupled to a data structure because some other module needs the data. The module gets the data and passes it to the other module without touching the "tramp data" ((M. Page-Jones: //The Practical Guide to Structured Systems Design//)). | ||
| - | * //Logical coupling//: A module makes some assumptions about another module without referencing it. For example a module //A// only sorts a list because some other module //B// which //A// technically does not know about needs it sorted. | ||
| + | In summary, P values are a statistical measure used to determine the probability of obtaining a result as extreme as, or more extreme than, the observed result under the null hypothesis. They play a critical role in hypothesis testing, but should always be interpreted in the context of the study design and other relevant factors. | ||
| + | Calculating P Values | ||
| - | ===== Rationale ===== | ||
| - | If a module //A// interacts with a module //B//, there is a certain dependency between these modules. When for example //A// uses a certain functionality of //B//, then //A// depends on //B//. //A// makes the assumption that //B// provides a certain service, and moreover it makes assumptions on how this service can be used (by which mechanism, which parameters, etc.). If one of these assumptions | + | Calculating P values |
| - | Furthermore if //A// makes many and detailed assumptions about //B//, there is also a high probability that //A// has to change despite only relying on one other module. This is because in such a case //A// also needs to change when only a certain detail | + | Preparation |
| - | But if coupling is low, there are only few assumptions | + | To calculate P values, you need to have a dataset that meets certain |
| + | Selection of Statistical Test | ||
| - | ===== Strategies ===== | + | The selection of the appropriate statistical test depends on the type of data you have and the research question you are trying to answer. For example, if you have two independent groups, you can use a two-sample t-test, while a one-sample t-test can be used to compare the mean of a sample to a known value. If you have more than two groups, you can use an ANOVA test. |
| - | * Indirection: | + | Execution |
| - | * Dependency Inversion/ | + | |
| - | * Use lower form of coupling | + | |
| - | * Merge modules: when there is only one module, then there is no communication and thus no coupling | + | |
| - | * Hide information: | + | |
| - | ===== Caveats ===== | + | Once you have selected the appropriate statistical test, you can execute the test using software such as R or SPSS. The software will calculate the test statistic, which is used to determine the P value. The test statistic is calculated by comparing the observed sample mean to the expected population mean under the null hypothesis. |
| - | Coupling can be reduced by several technical measures (see [[# | + | Interpreting Test Results |
| - | Furthermore note that coupling to a stable module | + | After executing the test, you will obtain |
| - | See also section [[#contrary principles]]. | ||
| + | In conclusion, calculating P values is an important step in hypothesis testing. By following the steps outlined above, you can accurately determine the probability of obtaining a sample mean as extreme as the one observed, assuming the null hypothesis is true. | ||
| + | P Values and Sample Size | ||
| - | ===== Origin ===== | + | Effect of Sample Size on P Values |
| - | /* the *primary* source */ | + | |
| - | * W. P. Stevens, | + | |
| - | ===== Evidence ===== | + | Sample size is an important factor in determining the accuracy of statistical tests. The larger the sample size, the more reliable the results of the test. When the sample size is small, the p-value can be misleading. A small p-value may indicate statistical significance, |
| - | /* Comment out what is not applicable and explain | + | |
| - | /* * [[wiki: | + | |
| - | * [[wiki: | ||
| - | * [[wiki: | ||
| - | /* * [[wiki: | + | For example, if a study with a small sample size finds a p-value of 0.05, it may indicate that there is a significant difference between the groups being compared. However, if the same study were repeated with a larger sample size, the p-value may be much smaller, indicating an even more significant difference. |
| + | Adjusting for Sample Size | ||
| - | ===== Relations | + | To adjust for the effect of sample size on p-values, researchers often use a correction factor called the Bonferroni correction. This correction factor adjusts the p-value threshold for multiple comparisons. For example, if a study is comparing three groups, the p-value threshold for statistical significance should be adjusted |
| - | ==== Generalizations ==== | ||
| - | ==== Specializations ==== | + | Another way to adjust for sample size is to use effect size measures such as Cohen' |
| - | * [[Constantine' | ||
| - | * [[Dependency Inversion Principle]] (DIP): LC aims at reducing the dependencies to other modules. One way to do so is to only depend on abstractions. DIP is about this aspect. | ||
| - | ==== Contrary Principles ==== | + | In summary, sample size plays an important role in determining the accuracy and reliability of statistical tests. A larger sample size can make small differences statistically significant, |
| + | Types of Errors | ||
| - | * [[Keep It Simple Stupid]] (KISS): Reducing the coupling often involves the use of complicated interaction patterns, indirections, | + | Type I and Type II Errors |
| - | * [[High Cohesion]] (HC): A system consisting of one single module has a very low coupling as there are no dependencies on other modules. But such a system also has low cohesion. The other extreme, very many highly cohesive modules, naturally has a higher coupling between the modules. So here a compromise has to be found. | + | |
| - | * [[Rule of Explicitness]] (RoE): Direct communication typically has the disadvantage of a higher coupling. Indirection reduces coupling but creates implicit/ | + | |
| - | ==== Complementary Principles ==== | + | |
| - | * [[Tell, don't Ask/ | + | When conducting hypothesis testing, there are two types of errors that can occur: Type I and Type II errors. Type I error occurs when the null hypothesis is rejected when it is actually true. This is also known as a false positive. Type II error occurs when the null hypothesis is not rejected when it is actually false. This is also known as a false negative. |
| - | * [[Model Principle]] (MP): LC aims at reducing | + | |
| - | * [[Information Hiding/ | + | |
| - | ==== Principle Collections ==== | ||
| - | {{page> | + | In hypothesis testing, the significance level (alpha) is the probability of making a Type I error. |
| - | {{page> | + | |
| - | {{page> | + | |
| - | ===== Examples ===== | + | Relationship Between Errors and P Values |
| + | The p value is the probability of obtaining a test statistic as extreme or more extreme than the observed statistic, assuming the null hypothesis is true. If the p value is less than or equal to the significance level, then the null hypothesis is rejected. | ||
| - | ===== Description Status ===== | ||
| - | /* Choose one of the following and comment out the rest: */ | ||
| - | / | ||
| - | [[wiki: | + | When the null hypothesis is true, the p value follows a uniform distribution between 0 and 1. The significance level is the cutoff point that is used to determine whether the null hypothesis is rejected or not. If the p value is less than or equal to the significance level, then the null hypothesis is rejected. |
| - | / | ||
| - | ===== Further Reading ===== | + | If the significance level is set too low, then the probability of making a Type II error increases. On the other hand, if the significance level is set too high, then the probability of making a Type I error increases. Therefore, it is important to choose an appropriate significance level based on the context of the problem and the consequences of making a Type I or Type II error. |
| + | P Values in Different Disciplines | ||
| - | * Albert Endres and Dieter Rombach: // | + | P Values in Medical Research |
| - | * [[wp> | + | |
| - | * [[wiki> | + | |
| - | * Martin Fowler: // | + | |
| - | * {{page> | + | |
| - | ===== Discussion ===== | + | P values are widely used in medical research to determine the statistical significance of the results. In medical research, the p-value is used to determine whether the results of a study are due to chance or whether they are statistically significant. A p-value of less than 0.05 is generally considered statistically significant in medical research. |
| - | Discuss this wiki article and the principle on the corresponding [[talk: | ||
| + | Medical researchers use p-values to determine whether a new treatment is effective. For example, if a new drug is being tested to treat a particular disease, the researchers would compare the results of the treatment group to the control group to see if there is a statistically significant difference between the two groups. | ||
| + | |||
| + | P Values in Social Sciences | ||
| + | |||
| + | P values are also commonly used in social sciences to determine the statistical significance of the results. In social sciences, the p-value is used to determine whether the results of a study are due to chance or whether they are statistically significant. A p-value of less than 0.05 is generally considered statistically significant in social sciences. | ||
| + | |||
| + | |||
| + | Social scientists use p-values to determine whether a particular intervention is effective. For example, if a social scientist is testing a new program to reduce crime, the researcher would compare the crime rates in the intervention group to the control group to see if there is a statistically significant difference between the two groups. | ||
| + | |||
| + | |||
| + | P-values are also used in psychology to determine the statistical significance of the results. For example, if a psychologist is testing a new therapy to treat a particular mental disorder, the researcher would compare the results of the treatment group to the control group to see if there is a statistically significant difference between the two groups. | ||
| + | |||
| + | |||
| + | Overall, p-values are a useful tool in various disciplines to determine the statistical significance of the results. However, it is important to note that p-values should not be the only factor considered when interpreting the results of a study. Other factors such as effect size, sample size, and study design should also be taken into account. | ||
| + | Software and Tools for P Value Calculation | ||
| + | Statistical Software Overview | ||
| + | |||
| + | Statistical software is a powerful tool for calculating p values. These software programs are designed to provide a comprehensive set of statistical analysis tools and are commonly used in research and data analysis. Some of the popular statistical software programs that can be used for p value calculation include: | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | R: R is a free and open-source statistical software that provides a wide range of statistical analysis tools. It is widely used in the scientific community for data analysis and visualization. R provides a comprehensive set of statistical functions that can be used to calculate p values. | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | SPSS: SPSS is a commercial statistical software that is widely used in the social sciences. It provides a user-friendly interface and a wide range of statistical functions that can be used to calculate p values. | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | SAS: SAS is a commercial statistical software that is widely used in the healthcare industry. It provides a wide range of statistical functions that can be used to calculate p values. | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | Stata: Stata is a commercial statistical software that is widely used in the social sciences, economics, and biostatistics. It provides a wide range of statistical functions that can be used to calculate p values. | ||
| + | |||
| + | |||
| + | |||
| + | Using Spreadsheets for P Value Calculation | ||
| + | |||
| + | Spreadsheets are a popular tool for data analysis and can also be used for p value calculation. Microsoft Excel is one of the most widely used spreadsheet programs and provides a wide range of statistical functions that can be used to calculate p values. | ||
| + | |||
| + | |||
| + | To calculate p values in Excel, users can use the built-in functions such as T.TEST, Z.TEST, and CHISQ.TEST. These functions can be used to calculate p values for different types of statistical tests including t-tests, z-tests, and chi-squared tests. | ||
| + | |||
| + | |||
| + | In addition to Excel, there are also other spreadsheet programs such as Google Sheets and LibreOffice Calc that provide similar statistical functions for p value calculation. | ||
| + | |||
| + | |||
| + | Overall, statistical software and spreadsheets are powerful tools for p value calculation. These tools provide a wide range of statistical functions that can be used to calculate p values for different types of statistical tests. | ||
| + | Limitations of P Values | ||
| + | |||
| + | P values are commonly used in statistical hypothesis testing to determine whether there is a significant difference between two groups or if an observed effect is due to chance. However, there are several limitations to the use and interpretation of p values that researchers must be aware of. | ||
| + | |||
| + | Misinterpretations of P Values | ||
| + | |||
| + | One common misinterpretation of p values is that they measure the size or importance of an effect. However, p values only indicate the probability of observing a result as extreme or more extreme than the one observed assuming that the null hypothesis is true. They do not provide any information about the magnitude or clinical significance of the effect. | ||
| + | |||
| + | |||
| + | Another common misinterpretation of p values is that a small p value means that the null hypothesis is false, or that the observed effect is real. However, a small p value only indicates that the observed result is unlikely to occur by chance assuming that the null hypothesis is true. It does not provide evidence for the alternative hypothesis or the presence of a real effect. | ||
| + | |||
| + | Alternatives to P Values | ||
| + | |||
| + | There are several alternatives to p values that can be used to assess the strength of evidence in statistical hypothesis testing. These include confidence intervals, effect sizes, and Bayesian methods. | ||
| + | |||
| + | |||
| + | Confidence intervals provide a range of values that are likely to contain the true population parameter with a certain degree of confidence. They provide information about the precision and uncertainty of the estimate, and can be used to test hypotheses by checking whether the null value is contained within the interval. | ||
| + | |||
| + | |||
| + | Effect sizes provide a measure of the magnitude and direction of an effect, independent of sample size. They can be used to compare the strength of effects across studies, and to estimate the practical significance of an effect. | ||
| + | |||
| + | |||
| + | Bayesian methods provide a framework for updating prior beliefs about the probability of a hypothesis given the observed data. They can be used to calculate the probability of the null and alternative hypotheses, and to quantify the strength of evidence in favor of one hypothesis over another. | ||
| + | |||
| + | |||
| + | In conclusion, p values have several limitations that researchers must be aware of when interpreting statistical hypothesis testing results. Alternatives such as confidence intervals, effect sizes, and Bayesian methods can provide additional information about the strength of evidence and the magnitude of effects. | ||
| + | Best Practices for Reporting P Values | ||
| + | |||
| + | When reporting p values, it is important to follow best practices to ensure clear and accurate communication of statistical findings. The following guidelines should be followed: | ||
| + | |||
| + | Decimal Places | ||
| + | |||
| + | P values should be reported to the appropriate number of decimal places. A p-value larger than .01 should be reported to two decimal places, p-values between .01 and .001 to three decimal places, and p-values less than .001 simply as p -lt; .001. Do not write a zero in front of the p-value. Never write p = .000 (although some statistical software report this) because it's not possible. Instead, write p -lt; .001 [[https:// | ||
| + | |||
| + | Inclusion of All P Values | ||
| + | |||
| + | All p values for all variables within a study design should be reported, rather than only providing p values for variables with significant findings. The inclusion of all p values provides evidence for study validity and limits suspicion for selective reporting. It is also important to report the confidence interval (CI) of the point estimate to describe the precision and range of the potential difference between the two comparison groups [[https:// | ||
| + | |||
| + | Significance Threshold | ||
| + | |||
| + | Researchers usually set a cut-off for p values (.05, .01, or .001), which is known as the significance threshold. If the p value obtained falls below the cutoff, the accompanying result is deemed " | ||
| + | |||
| + | |||
| + | Overall, following these best practices for reporting p values will ensure that statistical findings are communicated accurately and clearly. | ||
| + | |||
| + | References | ||
| + | |||
| + | [[https:// | ||
| + | [[https:// | ||
| + | [[https:// | ||
| + | Frequently Asked Questions | ||
| + | What is the process for calculating a p-value in statistics? | ||
| + | |||
| + | The process for calculating a p-value in statistics involves determining the probability of observing a test statistic as extreme or more extreme than the one observed, assuming the null hypothesis is true. The p-value can then be compared to the significance level to determine if the null hypothesis should be rejected or not. The exact process for calculating a p-value depends on the type of statistical test being performed. | ||
| + | |||
| + | How can one determine a p-value using a t-test formula? | ||
| + | |||
| + | To determine a p-value using a t-test formula, one must calculate the test statistic using the formula for the t-test and then use a t-distribution table or software to determine the probability of observing a t-value as extreme or more extreme than the one observed, assuming the null hypothesis is true. | ||
| + | |||
| + | What steps are involved in calculating a p-value from chi-square? | ||
| + | |||
| + | To calculate a p-value from chi-square, one must first calculate the test statistic using the formula for chi-square. Then, the p-value can be determined using a chi-square distribution table or software to determine the probability of observing a chi-square value as extreme or more extreme than the one observed, assuming the null hypothesis is true. | ||
| + | |||
| + | How can a p-value be calculated from a dataset' | ||
| + | |||
| + | A p-value cannot be calculated directly from a dataset' | ||
| + | |||
| + | In what way can a p-value be computed manually without software? | ||
| + | |||
| + | A p-value can be computed manually without software by using a distribution table, such as a t-distribution or chi-square distribution table, to determine the probability of observing a test statistic as extreme or more extreme than the one observed, assuming the null hypothesis is true. This involves finding the row and column that correspond to the test statistic and reading the corresponding probability value from the table. | ||
| + | (Image: [[https:// | ||
| + | What methods are available for calculating a p-value in Excel? | ||
| + | |||
| + | Excel provides several built-in functions for calculating p-values, depending on the type of statistical test being performed. These include T.TEST for t-tests, CHISQ.TEST for chi-square tests, and Z.TEST for tests involving a normal distribution. Additionally, | ||
| + | (Image: [[https:// | ||
principles/low_coupling.txt · Last modified: by mellissam44
