Implement a test to compare the percentage of hens whose pancreatic secretions increased (post - pre) among the five treatment regimens and report a p-value. Here's my approach: From Data Set HORMONE.DAT: `Pansecpr` - Pancreatic secretion rate (pre) `Pansecpt` - Pancreatic secretion rate (post) `Hormone` - 1=Saline, 2=aPP, 3=CCK, 4=secretin, 5=VIP #I created a new variable to calculate the pancreatic secretion difference (post-pre) in R hormone.df$DPansec <- hormone.df$Pansecpt - hormone.df$Pansecpr #I created an indicator variable. A "success" is defined as the hen having an increase in pancreatic secretion. A "failure" is defined as the hen not having an increase in pancreatic secretion. hormone.df$Indicator <- ifelse(hormone.df$DPansec > 0, "Increase", "NoIncrease") #I created a contingency table HormoneObsTable <- table(hormone.df$Indicator,hormone.df$Hormone) 1 2 3 4 5 Increase 5 3 28 7 34 NoIncrease 25 32 137 31 96 #Convert table to percentage rowPerc(HormoneObsTable) 1 2 3 4 5 Total Increase 6.49 3.90 36.36 9.09 44.16 100.00 NoIncrease 7.79 9.97 42.68 9.66 29.91 100.00 Question: Am I correct to assume that I can run a Pearson's chi-squared test on the above data and get the following results? Pearson's Chi-squared test data: HormoneObsTable X-squared = 7.2213, df = 4, p-value = 0.1246
Implement a test to compare the percentage of hens whose pancreatic secretions increased (post - pre) among the five treatment regimens and report a p-value. Here's my approach:
From Data Set HORMONE.DAT:
`Pansecpr` - Pancreatic secretion rate (pre)
`Pansecpt` - Pancreatic secretion rate (post)
`Hormone` - 1=Saline, 2=aPP, 3=CCK, 4=secretin, 5=VIP
#I created a new variable to calculate the pancreatic secretion difference (post-pre) in R
hormone.df$DPansec <- hormone.df$Pansecpt - hormone.df$Pansecpr
#I created an indicator variable. A "success" is defined as the hen having an increase in pancreatic secretion. A "failure" is defined as the hen not having an increase in pancreatic secretion.
hormone.df$Indicator <- ifelse(hormone.df$DPansec > 0, "Increase", "NoIncrease")
#I created a contingency table
HormoneObsTable <- table(hormone.df$Indicator,hormone.df$Hormone)
1 2 3 4 5
Increase 5 3 28 7 34
NoIncrease 25 32 137 31 96
#Convert table to percentage
rowPerc(HormoneObsTable)
1 2 3 4 5 Total
Increase 6.49 3.90 36.36 9.09 44.16 100.00
NoIncrease 7.79 9.97 42.68 9.66 29.91 100.00
Question: Am I correct to assume that I can run a Pearson's chi-squared test on the above data and get the following results?
Pearson's Chi-squared test data: HormoneObsTable
X-squared = 7.2213, df = 4, p-value = 0.1246
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images