SlideShare a Scribd company logo
Complete Randomized Experimental
Design using R script
Dr. D. Dutta Roy
Psychology Research Unit
Indian Statistical Institute
Hypothetical data
• a1=1:10
• a2=5:14
• a3=10:19
• a4=data.frame(a1=1:5,a2=5:14,a3=10:19)
• a4
• summary(a4)
• a5=stack(a4)
• a5
• boxplot(a4, main="Systematic variation across three training
groups", ylab="Score",xlab="Training groups",col=c(2:4))
• colnames(a4)=c("Theory","Practical","Theory and practical")
• a6=aov(a5$values~a5$ind)
• summary(a6)
• tapply(a5$values,a5$ind,mean)
• tapply(a5$values,a5$ind,sd)
Fitted data and residual
• paste(a5$values)
• paste(a6$fitted.values)
• paste(a6$residuals)
Multiple Range test
• TukeyHSD(a6)
• plot(TukeyHSD(a6))
• kruskal.test(a5$values~a5$ind)
• barplot(tapply(a5$values,a5$ind,mean))
Assumptions
• dependent variable should be measured at the continuous level
(i.e., they are interval or ratio variables).
• two independent variables should each consist of two or more
categorical, independent groups.
• You should have independence of observations, which means that
there is no relationship between the observations in each group or
between the groups themselves.
• There should be no significant outliers.
• Your dependent variable should be approximately normally
distributed for each combination of the groups of the two
independent variables.
• There needs to be homogeneity of variances for each combination
of the groups of the two independent variables.

More Related Content

Similar to Crd with r script

Arrays
ArraysArrays
Arrays
Aman Agarwal
 
Joclad 2010 d
Joclad 2010 dJoclad 2010 d
Joclad 2010 d
a1000caroliveira
 
Text classification
Text classificationText classification
Text classification
Fraboni Ec
 
Text classification
Text classificationText classification
Text classification
David Hoen
 
Text classification
Text classificationText classification
Text classification
Harry Potter
 
Text classification
Text classificationText classification
Text classification
Luis Goldster
 
Text classification
Text classificationText classification
Text classification
Young Alista
 
Text classification
Text classificationText classification
Text classification
James Wong
 
Text classification
Text classificationText classification
Text classification
Tony Nguyen
 
06 1 조건문
06 1 조건문06 1 조건문
R is a very flexible and powerful programming language, as well as a.pdf
R is a very flexible and powerful programming language, as well as a.pdfR is a very flexible and powerful programming language, as well as a.pdf
R is a very flexible and powerful programming language, as well as a.pdf
annikasarees
 
Data science - Handling Outliers
Data science  - Handling OutliersData science  - Handling Outliers
Data science - Handling Outliers
Vasu Bajaj
 
r studio presentation.pptx
r studio presentation.pptxr studio presentation.pptx
r studio presentation.pptx
DevikaRaj14
 
r studio presentation.pptx
r studio presentation.pptxr studio presentation.pptx
r studio presentation.pptx
DevikaRaj14
 
Statistics Assignment Help
Statistics Assignment HelpStatistics Assignment Help
Statistics Assignment Help
Statistics Assignment Help
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
Sway Wang
 
my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;
my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;
my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;
dankogai
 
Intoduction to numpy
Intoduction to numpyIntoduction to numpy
Intoduction to numpy
Faraz Ahmed
 
CBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVS
CBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVSCBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVS
CBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVS
Gautham Rajesh
 

Similar to Crd with r script (19)

Arrays
ArraysArrays
Arrays
 
Joclad 2010 d
Joclad 2010 dJoclad 2010 d
Joclad 2010 d
 
Text classification
Text classificationText classification
Text classification
 
Text classification
Text classificationText classification
Text classification
 
Text classification
Text classificationText classification
Text classification
 
Text classification
Text classificationText classification
Text classification
 
Text classification
Text classificationText classification
Text classification
 
Text classification
Text classificationText classification
Text classification
 
Text classification
Text classificationText classification
Text classification
 
06 1 조건문
06 1 조건문06 1 조건문
06 1 조건문
 
R is a very flexible and powerful programming language, as well as a.pdf
R is a very flexible and powerful programming language, as well as a.pdfR is a very flexible and powerful programming language, as well as a.pdf
R is a very flexible and powerful programming language, as well as a.pdf
 
Data science - Handling Outliers
Data science  - Handling OutliersData science  - Handling Outliers
Data science - Handling Outliers
 
r studio presentation.pptx
r studio presentation.pptxr studio presentation.pptx
r studio presentation.pptx
 
r studio presentation.pptx
r studio presentation.pptxr studio presentation.pptx
r studio presentation.pptx
 
Statistics Assignment Help
Statistics Assignment HelpStatistics Assignment Help
Statistics Assignment Help
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
 
my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;
my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;
my$talk=qr{((?:ir)?reg(?:ular )?exp(?:ressions?)?)}i;
 
Intoduction to numpy
Intoduction to numpyIntoduction to numpy
Intoduction to numpy
 
CBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVS
CBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVSCBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVS
CBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVS
 

More from Dr. Debdulal Dutta Roy

Human resource management in educational institute
Human resource management in educational instituteHuman resource management in educational institute
Human resource management in educational institute
Dr. Debdulal Dutta Roy
 
Atari self efficacy in technology adoption
Atari self efficacy in technology adoptionAtari self efficacy in technology adoption
Atari self efficacy in technology adoption
Dr. Debdulal Dutta Roy
 
Crd with r script
Crd with r scriptCrd with r script
Crd with r script
Dr. Debdulal Dutta Roy
 
Life skills and Self-Development
Life skills and Self-DevelopmentLife skills and Self-Development
Life skills and Self-Development
Dr. Debdulal Dutta Roy
 
Rabindrik approach in school counselling
Rabindrik approach in school counsellingRabindrik approach in school counselling
Rabindrik approach in school counselling
Dr. Debdulal Dutta Roy
 
Noida rabindrik psychotherapy
Noida rabindrik psychotherapyNoida rabindrik psychotherapy
Noida rabindrik psychotherapy
Dr. Debdulal Dutta Roy
 
What is Questionnaire ? Lecture for Doctoral fellows in Management
What is Questionnaire ? Lecture for Doctoral fellows in ManagementWhat is Questionnaire ? Lecture for Doctoral fellows in Management
What is Questionnaire ? Lecture for Doctoral fellows in Management
Dr. Debdulal Dutta Roy
 

More from Dr. Debdulal Dutta Roy (7)

Human resource management in educational institute
Human resource management in educational instituteHuman resource management in educational institute
Human resource management in educational institute
 
Atari self efficacy in technology adoption
Atari self efficacy in technology adoptionAtari self efficacy in technology adoption
Atari self efficacy in technology adoption
 
Crd with r script
Crd with r scriptCrd with r script
Crd with r script
 
Life skills and Self-Development
Life skills and Self-DevelopmentLife skills and Self-Development
Life skills and Self-Development
 
Rabindrik approach in school counselling
Rabindrik approach in school counsellingRabindrik approach in school counselling
Rabindrik approach in school counselling
 
Noida rabindrik psychotherapy
Noida rabindrik psychotherapyNoida rabindrik psychotherapy
Noida rabindrik psychotherapy
 
What is Questionnaire ? Lecture for Doctoral fellows in Management
What is Questionnaire ? Lecture for Doctoral fellows in ManagementWhat is Questionnaire ? Lecture for Doctoral fellows in Management
What is Questionnaire ? Lecture for Doctoral fellows in Management
 

Recently uploaded

Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 

Recently uploaded (20)

Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 

Crd with r script

  • 1. Complete Randomized Experimental Design using R script Dr. D. Dutta Roy Psychology Research Unit Indian Statistical Institute
  • 2. Hypothetical data • a1=1:10 • a2=5:14 • a3=10:19 • a4=data.frame(a1=1:5,a2=5:14,a3=10:19) • a4 • summary(a4) • a5=stack(a4) • a5 • boxplot(a4, main="Systematic variation across three training groups", ylab="Score",xlab="Training groups",col=c(2:4)) • colnames(a4)=c("Theory","Practical","Theory and practical")
  • 3. • a6=aov(a5$values~a5$ind) • summary(a6) • tapply(a5$values,a5$ind,mean) • tapply(a5$values,a5$ind,sd)
  • 4. Fitted data and residual • paste(a5$values) • paste(a6$fitted.values) • paste(a6$residuals)
  • 5. Multiple Range test • TukeyHSD(a6) • plot(TukeyHSD(a6)) • kruskal.test(a5$values~a5$ind) • barplot(tapply(a5$values,a5$ind,mean))
  • 6. Assumptions • dependent variable should be measured at the continuous level (i.e., they are interval or ratio variables). • two independent variables should each consist of two or more categorical, independent groups. • You should have independence of observations, which means that there is no relationship between the observations in each group or between the groups themselves. • There should be no significant outliers. • Your dependent variable should be approximately normally distributed for each combination of the groups of the two independent variables. • There needs to be homogeneity of variances for each combination of the groups of the two independent variables.