Paired Sample t test and chi square

9 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€64.99
List Price:  €92.85
You save:  €27.85
£55.77
List Price:  £79.68
You save:  £23.90
CA$95.68
List Price:  CA$136.70
You save:  CA$41.01
A$105.96
List Price:  A$151.38
You save:  A$45.42
S$94.48
List Price:  S$134.98
You save:  S$40.50
HK$546.78
List Price:  HK$781.15
You save:  HK$234.36
CHF 63.33
List Price:  CHF 90.48
You save:  CHF 27.14
NOK kr761.11
List Price:  NOK kr1,087.35
You save:  NOK kr326.23
DKK kr485.02
List Price:  DKK kr692.92
You save:  DKK kr207.89
NZ$116.44
List Price:  NZ$166.35
You save:  NZ$49.91
د.إ257.06
List Price:  د.إ367.25
You save:  د.إ110.18
৳7,660.01
List Price:  ৳10,943.35
You save:  ৳3,283.33
₹5,835.78
List Price:  ₹8,337.18
You save:  ₹2,501.40
RM331.75
List Price:  RM473.95
You save:  RM142.20
₦86,437.65
List Price:  ₦123,487.65
You save:  ₦37,050
₨19,492.21
List Price:  ₨27,847.21
You save:  ₨8,355
฿2,572.74
List Price:  ฿3,675.50
You save:  ฿1,102.76
₺2,264.43
List Price:  ₺3,235.04
You save:  ₺970.61
B$355.02
List Price:  B$507.19
You save:  B$152.17
R1,295.44
List Price:  R1,850.71
You save:  R555.27
Лв127.05
List Price:  Лв181.51
You save:  Лв54.46
₩94,909.58
List Price:  ₩135,590.93
You save:  ₩40,681.35
₪260.15
List Price:  ₪371.66
You save:  ₪111.51
₱3,993.87
List Price:  ₱5,705.78
You save:  ₱1,711.90
¥10,713.01
List Price:  ¥15,304.96
You save:  ¥4,591.95
MX$1,187.73
List Price:  MX$1,696.83
You save:  MX$509.10
QR254.83
List Price:  QR364.06
You save:  QR109.23
P950.82
List Price:  P1,358.38
You save:  P407.55
KSh9,247.76
List Price:  KSh13,211.65
You save:  KSh3,963.89
E£3,352.12
List Price:  E£4,788.95
You save:  E£1,436.83
ብር4,006.43
List Price:  ብር5,723.72
You save:  ብር1,717.28
Kz58,511.64
List Price:  Kz83,591.64
You save:  Kz25,080
CLP$65,950.47
List Price:  CLP$94,219
You save:  CLP$28,268.52
CN¥506.53
List Price:  CN¥723.65
You save:  CN¥217.11
RD$4,055.76
List Price:  RD$5,794.19
You save:  RD$1,738.43
DA9,420.16
List Price:  DA13,457.95
You save:  DA4,037.79
FJ$157.70
List Price:  FJ$225.30
You save:  FJ$67.59
Q542.52
List Price:  Q775.06
You save:  Q232.54
GY$14,601.52
List Price:  GY$20,860.22
You save:  GY$6,258.69
ISK kr9,773.40
List Price:  ISK kr13,962.60
You save:  ISK kr4,189.20
DH703.98
List Price:  DH1,005.73
You save:  DH301.75
L1,236.34
List Price:  L1,766.28
You save:  L529.93
ден3,998.26
List Price:  ден5,712.05
You save:  ден1,713.78
MOP$561.77
List Price:  MOP$802.57
You save:  MOP$240.79
N$1,291.99
List Price:  N$1,845.78
You save:  N$553.78
C$2,569.36
List Price:  C$3,670.67
You save:  C$1,101.31
रु9,319.09
List Price:  रु13,313.56
You save:  रु3,994.46
S/260.54
List Price:  S/372.22
You save:  S/111.67
K269.79
List Price:  K385.44
You save:  K115.64
SAR262.50
List Price:  SAR375.01
You save:  SAR112.51
ZK1,882.68
List Price:  ZK2,689.66
You save:  ZK806.98
L323.40
List Price:  L462.03
You save:  L138.62
Kč1,628.77
List Price:  Kč2,326.92
You save:  Kč698.14
Ft25,334.28
List Price:  Ft36,193.38
You save:  Ft10,859.10
SEK kr755.02
List Price:  SEK kr1,078.64
You save:  SEK kr323.62
ARS$61,468.17
List Price:  ARS$87,815.44
You save:  ARS$26,347.26
Bs483.33
List Price:  Bs690.51
You save:  Bs207.17
COP$271,845.87
List Price:  COP$388,367.89
You save:  COP$116,522.02
₡35,672.25
List Price:  ₡50,962.55
You save:  ₡15,290.29
L1,724.16
List Price:  L2,463.20
You save:  L739.03
₲522,510.75
List Price:  ₲746,475.93
You save:  ₲223,965.17
$U2,674.97
List Price:  $U3,821.56
You save:  $U1,146.58
zł281.37
List Price:  zł401.98
You save:  zł120.60
Already have an account? Log In

Transcript

Welcome to clinical data management program using SAS. In this video I'll be discussing with you all the concept of paired sample t test and chi square test for independence of attributes. So, let me explain you all the concept of paired sample t test using case study. So suppose the blood pressure of 30 patients have increased Suddenly, a new medicine named abt is launched. Now we need to check the effects of medicines on the patient's blood pressure. So basically, we have to first check the blood pressure of the patients without the medicine and then we have to check the blood pressure of the medicine, the pressure of the patients with the medicine and then we have to compare both that is without the medicine with the medicine.

So my null hypothesis over here will be new pre equals to new post that is new before is equal to new after and the alternative hypothesis will be new pre is not equal to new post. So let me first import the data set. So your proc import data file it was within Double codes you have to give the path of the data. So let's take the path from here and let's get the name of the paired sample t test data. Out equals pair that is after import the data once the data comes to the SAS environment anymore, the data set will be paid, replace and then run. Let's run this code this is my bad data set.

See it consists of two variables one is before and after before those without the given giving the medicine and after is after giving the medicine. The impact on the blood pressure now we have to compare them Back to the patient and the patient's before and after giving the medicine so for that we're going to run the t test procedure. We'll be using the procedure called proc t test data equals paired then paired keyword we have to use to do paired sample t test before star after, because star after means it is basically showing the interaction effect between before and after variable and then run and then quit. So, let's run this code Okay, so here my P value is very much less than 0.05. As you know in SAS the default level of significance is 5%. So since my P value is less than the level of Against soy reject my null hypothesis that means new P is not equal to new post.

So, this much conclusion I can withdraw that is the average regression of the patients in presence of medicines and in absence of medicines are always it's obviously not safe because they have to accept the alternative hypothesis that is new please not equal to new post. So, this is your concept of paired sample t test. Now let's move to the concept of chi square test independence of attributes chi square test independence of attributes basically talks about the association between the two categorical variables. So we basically check whether the two categorical variables are associated to each other or not. Whether my there my null hypothesis is basically there is no association between the two categorical variables and my alternative hypothesis is there is an association between the two categorical variables. So chi square test is used to check whether there is any association between the attributes, but it does not tell what is the nature of the association nature of the association is basically the degree of association between the two variables or are checked by correlation but in chi square test we only know that whether the two categorical variables are related to each other or not.

And in chi square test for independence of attributes a contingency table is generated, which am the table consists of the frequency of each and every data value or we can say the contingency table basically consists of the frequency of each and every category of our data. So, there are certain assumptions which we need to remember to do the chi square test independence for attributes. First there should be categorical variables in the data set second total frequency should be reasonably large say greater than 50 the observations of the sample should be independent that is they should not get influenced by each other. Next, the theoretical frequency of any category or class should not be less than pi. So, now let's do the procedure of chi square test independence of attributes we will be using the frequency procedure to do chi square test independence for attributes we'll be using the procedure called proc freak data before I run the chi square test first we have to import the data.

So, let me Use a procedure called proc import data file to import the data proc import data file equals to within double quotes have to give the path. Let me give the path from here then have to give the data set name is Chi underscore square dot CSV and equals to say I give the name of the data set as chi square that is after I import the CSV file into SAS, the name of the data set will be chi square which would be created and said work then give the key word replace and Linda let's run this code. This is my chi square data. Before I explain all the data Let me explain your objective of chi square test that we are going to fulfill now. Basically, we have got a certain age group of patients suppose there are three age groups of people or patients who are teenagers, middle aged or senior citizen they are suffering from cancer and they are given chemo therapies, the side effects of the patients are noted, the patients are having the following side effects they're having indigestion they're having my hair for or they're having skin damage.

Now I want to test whether there is any association between the two categorical variables that is age group and the side effects of the that the patients are having after the chemotherapy. So this is my data consisting of age group and side effects after chemotherapy. These are the age groups of the patient. There are three age groups of patients that is teenagers, middle aged and senior citizen and side effects that they're having either indigestion or they're having hair color, they're having skin damage, so I will check whether these two variables or these two categorical variables are related to each other or not. So for this, I'm going to use the procedure called proc freak data equals k square tables. I've been doing cross tabulation I'm doing each group.

This is my first categorical variable. Just because we are doing cross tabulation via using star then side effects after chemo we are going to use the keyword called chi square and then let's run this code. So see this is your contingency table first values your frequency. That is there are how many patients who are delicious and suffering from hair fall how many middle aged patients suffering from indigestion how many many less patients suffering from skin damage and total is 24. So first is my frequency. Second is my frequency percent.

Next is zero. percent and next is MC column percent frequency percent means level like 70% 19 is basically 11 by total into hundred. So, individual frequency by total frequency into unwitnessed frequency percent row percentages out of the total middle aged patients, how much percent of the patients are suffering from careful are getting the side effect as helpful that is 45.83 and out of the total patients who are having a fall what is the percentage of patients who are middle aged 39.29 to 39.29 is my column percent that is 11 by 28 in 245.83 is my row percent that is 11 by 24 and 217 point 19 has a frequency percent that is 11 by 64 and 211 has been your frequency. So, these are this is your contingency table and next The most important thing is your P value that is 0.0026 so, it is less than 0.05.

So, I will be rejecting my null hypothesis that is there will be association between these two data Vertical variables, that is the side effects that the patients are having and the age groups of the patients. So this is my concept of chi square test independence of attributes. And these are the types of the tests that we can perform and testing of hypotheses using SAS clinical data for now I'll end this video over here. In my coming videos I will be discussing with you all about ANOVA and regression. Thank you, goodbye. See you all for the next video.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.