In a study, the effectiveness of the influenza vaccination is recorded. A sample of 1000 people is vaccinated on December 1st, while a second group of 2350 people is treated with a placebo. There are 20 cases of influenza in the vaccinated group, while the cases of influenza in the non-vaccinated group are 80. Can it be claimed that the vaccine has a significant effectiveness in prevention? Display the data in an appropriate graph.
The data we are dealing with are categorical (vaccine/placebo) and (influenza_yes/influenza_no).
I construct the contingency table considering that I will have E+ E- in columns and M+ M- in rows.
Significant association between the drug and influenza.
In particular, if I want to calculate the risk associated with vaccination, I calculate the cross-ratio.
OR<- (A*D)/(B*C) == 0.5790816
The dietitian Mario Smilzo claims that his diet leads to very rapid weight loss. To demonstrate it, he takes a group of 10 people and weighs them before and after the diet. Their weight before the diet and after the diet was
This is a comparison between a continuous variable, WEIGHT, and a categorical variable, PRE/POST.
It is a paired study.
The most suitable test appears to be a paired t-test, but before deciding, we need to check if the assumptions are met.
In this case as well, the diet is effective and results in a reduction of 8.1 kg.
To see if the weight loss is different between the two diets, I can approach it in various ways, one of which is to check if there are differences between the weight change (delta) values for the two diets. I will generate the two delta vectors for both diets (Pre-Post).
To see if the weight loss is different between the two diets, I can take different approaches, and one of them is to check if there are differences between the weight change (delta) values for the two diets.
I generate the two DELTA vectors for both diets (Pre-Post).
I check the normality and homoscedasticity of the Delta variable and then apply an unpaired t-test.
Although there is a substantial weight delta between the two diets, the test is not significant, so we cannot reject the null hypothesis that there are no differences.
Some researchers suspect that a gene polymorphism of the BRCA2 gene may confer a risk of breast cancer. To test this hypothesis, a case-control study is conducted. 200 patients and 200 controls are genotyped, and the frequencies of the identified genotypes are as shown in the table.
Calculate if the frequency of the T allele is significantly higher and estimate the risk using the most appropriate estimation.
I calculate the allelic frequency to reduce it to a 2x2 table.
I apply a Fisher's test to calculate the odds ratio directly.
The allele A confers a significant risk factor, and the risk is quantified as OR = 1.8.
A study aims to assess whether an anti-tumor drug can reduce tumor size. The drug is administered to three groups of guinea pigs: an untreated group (NO_F), a group treated with the experimental drug (F_SPE), and a group treated with the traditional drug (F_TRA). The results related to the dry weight of the biopsy in mg are as reported in the table.
There is a significant difference only between the treated and untreated groups, but between the two treatments, the difference is not statistically significant.
It is suspected that the lack of response to a drug is attributable to reduced expression of its cellular receptor. The drug is very expensive, and its administration would be futile in non-responders. A proteomic experiment is conducted to quantify protein levels in a group of responders and non-responders. The measured levels are in densitometric units.
In this case as well, we are dealing with a comparison between groups, and the t-test appears to be the most appropriate. So, I check if the conditions for its application exist.
Analysis of normality and homoscedasticity confirms that it is possible to apply a parametric test, so an independent t-test is chosen.
The test is significant and reveals average levels of 128.3 in the Responders group and 106.8 in the non-Responders group.
In a hospital, it is hypothesized that living conditions and stress levels can influence the response to a particular therapy. If that were the case, many of the therapy's outcomes could be improved by addressing living conditions. To this end, a correlation is sought between the quality of life (QOL), assessed using questionnaire scores (ranging from 1 to 100), and the therapy response (R2T), assessed using a clinical improvement score (ranging from 1 to 10). The results obtained from a sample of 10 subjects are as follows:
Check if there is a correlation.
The data are ordinal categorical, so a non-parametric correlation test is applied as a choice.
Use the dataset CENTENARI_BIOCHEMISTRY and check if total cholesterol, smoking, and blood glucose represent risk factors for a heart attack. Calculate their effect on the risk of a heart attack.
I use the read.table function after saving the data in tab-delimited text format (.txt). I specify that the file has a header, and the symbol that separates the columns is a tabulation with sep="\t".
Note: If you import the data using a graphical interface, be careful with MISSING DATA. They should be indicated in the import options screen. Choose how missing data are represented; in the example, they are indicated as NA, but in other cases, they could be represented as empty cells.
Note: In this example, an object named DATA has been created to contain the data. If you import the CENTENARI_BIOCHEMISTRY file using the graphical interface in R, an object named CENTENARI_BIOCHEMISTRY will be created instead of DATA. Of course, you should modify the following commands accordingly, or create a copy named DATA that contains CENTENARI_DATA.
First, check the type of variables with:
Most of the variables are numeric or integer; the only incorrect ones are Gruppo, uo, pid, FUMO, INFARTO, INSUFF_RENE, DIABETE, TEST_1_DIABETE, and TEST_2_DIABETE.
I will make them categorical. This is an important operation because R will treat them appropriately during the analysis.