BRM File Final
BRM File Final
On
“BUSINESS RESEARCH METHODOLOGY”
Supervised By Submitted By
Dr. Simranjeet Kaur Bagga Name- PULKIT JAIN
Assistant Professor Roll No.- 36115101723
DECLARATION
I hereby declare that the following documented practical lab file titled “Business Research
Methodology” submitted by me to Management Education and Research Institute is a bona fide
work undertaken and has not been submitted to any other University or Institution for the award
of any degree diploma/certificate or published any time before.
I hereby certify that all the Endeavour put in the fulfillment of the task are genuine and original
to the best of my knowledge & I have not submitted it earlier elsewhere.
Signature
PULKIT JAIN
PAGE \* MERGEFORMAT 2
INTERNAL GUIDE CERTIFICATE
To whomsoever it may concern
This is to certify that the practical lab file work “Business Research Methodology” made by
PULKIT JAIN , BBA, 3rd Semester(B) is an authentic work carried out by her under the
supervision of Internal Guide Dr. Simranjeet Kaur Bagga.
The project report submitted has been found satisfactory for the partial fulfillment of the degree
of Bachelor of Business Administration.
PAGE \* MERGEFORMAT 2
ACKNOWLEDGEMENT
I have been very fortunate to get the opportunity to work on Practical Lab File, “Business
Research Methodology”. I hereby take this opportunity to express my profound gratitude
towards Guru Gobind Singh Indraprashta University for giving me an opportunity to work on a
valuable project.
I would like to extend my deepest regards and gratefulness to Dr. Simranjeet Kaur Bagga
ma’am, my project guide who continuously guided me throughout the course of the project.
Monitoring and constant encouragement throughout the course of this study made the successful
completion of this project possible.
Signature
PULKIT JAIN
TABLE OF CONTENTS
PAGE \* MERGEFORMAT 2
S.NO TITLE PAGE NO. SIGNATURE
1 Introduction to R 5-9
PRACTICAL NO. 1
PAGE \* MERGEFORMAT 2
1.1: INTRODUCTION TO R, THE LANGUAGE
R itself is a language and environment for statistical computing and graphics, which operates as
an integrated suite of software facilities for data manipulation, calculation, and graphical display.
It includes:
R is a powerful and effective tool for computing, statistics and analysis, and producing data
visualizations. However, many applications exist that can do these or similar things. R has a
number of benefits that make it particularly useful, though.
1.1.1: BENEFITS OF R
First, R is both open source and free. This allows you to take the tool and the skills you’ve
learned with you wherever you go; you are not dependent on your employer to buy or have a
license of a particular software. This is especially relevant as many other software with similar
functionality often cost hundreds, if not thousands, of dollars for a single license.
The open-source nature of R has also resulted in a robust set of users across a wide variety of
disciplines who are constantly updating and revising the language. R therefore has some of the
most up-to-date and innovative functionality and methods available to its users, should they
know where to look.
1.1.2: PACKAGES
PAGE \* MERGEFORMAT 2
Within R, these functions and tools are often implemented as packages. Packages allow
advanced users of R to contribute statistical methods and computing tools to the general users
of R. These packages are reviewed and vetted before being made available for public use; they
are often frequently updated as well. In the first lab, we will install some basic packages that are
frequently used throughout the course.
1.2: R.STUDIO
R Studio is an integrated development environment (IDE) that makes R a bit more user-
friendly. While it is not the only way to use R, it provides a helpful and intuitive interface for
writing and editing code, as well as creating documents and reports. It is not, however, a
requirement for using the R language.
Additionally, it is important to note that R Studio is an entirely separate piece of software - it will
need to be downloaded separately from R.
1.2.1: NAVIGATING RSTUDIO
As you can see, the R Studio interface is primarily composed of 4 quadrants. In the upper-left
corner is the source pane. This is the primarily location where most of your work will take place.
You will write and edit collections of code - or R Scripts - here. When working in the source
pane, your code will not compile until you tell it to run; this allows you the flexibility to work at
your own pace, as well as to save your work.
In the lower left corner is the console, or the command window. The console is the powerhouse
of the software; this is where R actually evaluates code. While you can type code directly into
the console and receive immediate results, it is advisable to stick to the source pane while you
are learning how to use R. Running code in the source pane will automatically produce output in
the console pane.
PAGE \* MERGEFORMAT 2
The upper-right quadrant contains the Environment and History tabs. The Environment tab
displays a list of all the data objects that you have defined in your current R session, as well as
some basic details about the data (such as the number of observations and variables in each). The
History tab contains an archive of all the commands you’ve run in the current session.
Finally, the lower-right quadrant holds a number of helpful navigation tabs. The “Files” tab
displays your hard drive’s own file directory for easy access. The “Plots” tab will show the plots
and visualizations you have created in your current R session. The “Packages” tabs show a list of
all the packages currently installed, as well as an indication of whether or not that are loaded in
the current session. The “Help” tab is, unsurprisingly, the help menu.
Until you are comfortable writing and executing code to analyze data, the RStudio interface can
seem intimidating. Remember - since these are open-source software, there are plenty of
resources online to help as well. A “cheat sheet” for the RStudio IDE can be found here.
1.3: R MARKDOWN
Markdown is a tool for converting plain text into formatted text. R Markdown utilizes the
markdown syntax in order to combine formatted text with code in a single document.
Within RStudio, R Markdown is a specific type of file format for making dynamic documents. It
allows you to simultaneously 1. save and execute code, and 2. produce high quality documents
that include both code and text.
For the purposes of our labs, R Markdown allows us to include code chunks and the text that
helps explain them in an easy-to-read manner. For your own use, R Markdown will allow you to
write documents and reports that include traditional formatted text, as well as the data
visualizations you make in class, and present them both together in a high-quality professional
document.
PAGE \* MERGEFORMAT 2
1.4: FEW COMMANDS
Here are definitions of some commonly used R commands, including ls and ls.str, along with a
few others that are helpful for data manipulation and exploration:
1. ls ()
2. ls.str()
● Purpose: Lists the objects in the current environment along with their structure.
● Usage: ls.str()
● Example: This command provides a brief overview of the objects, showing their type
and structure, which is useful for understanding the data.
3. str()
4. summary()
PAGE \* MERGEFORMAT 2
5. length()
6. class()
PAGE \* MERGEFORMAT 2
PRACTICAL NO.2
Write a program to take input from the user such as name and age and print their values.
Also join the name and age and print their values.
name=PULKIT JAIN
print(name)
#output
age=19
print(age)
#output
[1] 19
paste(name, age)
#output
PAGE \* MERGEFORMAT 2
PRACTICAL NO. 3`
PAGE \* MERGEFORMAT 2
PRACTICAL NO. 4
Write a program to illustrate the usage of all arithmetic, logical and relational operators
with two vectors.
#arithmetic operator.
vect1=c(0,2)
vect2=c(3,6)
paste("Addition")
[1] "Addition"
a=vect1+vect2
print(a)
#output
[1] 3 8
paste("Subtraction")
[1] "Subtraction"
b=vect1-vect2
print(b)
#output
[1] -3 -4
paste("Multiplication")
[1] "Multiplication"
c=vect1*vect2
print(c)
PAGE \* MERGEFORMAT 2
#output
[1] 0 12
paste("Division")
[1] 0 12
d=vect1/vect2
print(d)
#output
[1] 0.0000000 0.3333333
# Relational operator
vect1=c(0,2)
vect2=c(2,3)
Equal
print(paste("Equal",vect1==vect2))
Output
Not Equal
print(paste("Not Equal",vect1=vect2))
Output
Greater than(>)
print(paste("Greater than",vect1>vect2))
PAGE \* MERGEFORMAT 2
Output
Less than(<)
Output
#Logical operators
vect3=c(10,20,30,40,50)
vect4=c(5,10,15,20,25)
AND
Output
[1] "AND FALSE" "AND FALSE" "AND TRUE” “AND FALSE" "AND FALSE"
OR
Output
[1] "OR 0" "OR 0" "OR 1" "OR Inf" "OR Inf"
NOT
print(paste("NOT”, (vect3>20)))
Output
PAGE \* MERGEFORMAT 2
[1] "NOT FALSE" "NOT FALSE" "NOT TRUE” “NOT TRUE” “NOT TRUE
PRACTICAL NO. 5
Write a R program to find out the descriptive statistics value of numeric vector through
specified length of 5.
#Median
median(x)
#output
[1] 60
#Minimum
min(x)
#output
[1] 20
#Maximum
max(x)
#outpu
[1] 100
#Sum
PAGE \* MERGEFORMAT 2
sum(x)
#output
[1] 300
#Lenth
length(x)
#output
[1] 5
PAGE \* MERGEFORMAT 2
PRACTCIAL NO. 6
Write a R program to create a matrix of both numeric and character to assess and modify.
a=c(1,2,3,4,5,6,7,8,9)
matrix1=matrix(a,nrow=3,ncol=3,byrow=TRUE)
matrix1[2,2]
[1] 5
print(matrix1)
Output
[1,] 1 2 3
[2,] 4 5 6
[3,] 7 8 9
[1] "new matrix: 1" "new matrix: 4" "new matrix: 7" "new matrix: 2"
[5] "new matrix: 5" "new matrix: 8" "new matrix: 3" "new matrix: 6"
PAGE \* MERGEFORMAT 2
#Modifying the element
matrix1[2,2] =100
print(matrix1)
Output
[1,] 1 2 3
[2,] 4 100 6
[3,] 7 8 9
print(a)
Output
print (a [2,3])
PAGE \* MERGEFORMAT 2
Output
[1] "F"
a [1,1] <-"x"
a [2,3] <-"y"
print(a)
Output
PAGE \* MERGEFORMAT 2
PRACTICAL NO.7
Write a R program to Create a list using Numeric and Character vectors in R. Access and
modify it also and merge also.
list=list (6,7,9)
print(list)
#output
[[1]]
[1] 6
[[2]]
[1] 7
[[3]]
[1] 9
#access
list [2]
#output
[[1]]
[1] 7
PAGE \* MERGEFORMAT 2
[2] #Modify
list [3] =1
print(list)
#output
[[1]]
[1] 6
[[2]]
[1] 7
[[3]]
[1] 1
list1=list("tom","ram","Rohan")
print(list1)
#output
[[1]]
[1] "tom"
[[2]]
[1] "ram"
[[3]]
[1] "rohan"
PAGE \* MERGEFORMAT 2
#access
list1[1]
#output
[[1]]
[1] "tom"
#modify
list1[3]="jerry"
print(list1)
#output
[[1]]
[1] "tom"
[[2]]
[1] "ram"
[[3]]
[1] "jerry"
list2=c(list,list1)
print(list2)
#output
[[1]]
[1] 6
[[2]]
PAGE \* MERGEFORMAT 2
[1] 7
[[3]]
[1] 1
[[4]]
[1] "tom"
[[5]]
[1] "ram”
[[6]]
[1] "jerry"
PAGE \* MERGEFORMAT 2
PRACTICAL NO. 8
Write a R program to create a data frame, merge two data frames also.
print(frame)
#output
1 Rohit 18 male
2 Naman 19 male
3 Shreya 20 female
print(frame1)
#output
1 BBA 1 6.2
2 BJMC 1 8.9
3 BCA 3 7.8
PAGE \* MERGEFORMAT 2
#merging frames together
frame3=cbind(frame, frame1)
print(frame3)
#output
PAGE \* MERGEFORMAT 2
PRACTICAL NO. 9
Write a R program for loop statement such as if, else if, for and while and break statement.
X=0
if(x<0){
print(x)
if(x<0){
} else if(x>0){
}else{
Print(“Zero”)
Output
[1]”Zero
x=letters[4:10]
for(i in x) {print(i)}
[1] "d"
[1] "e"
PAGE \* MERGEFORMAT 2
[1] "f"
[1] "g"
[1] "h"
[1] "i"
[1] "j"
x=1
#print 1 to 5
+ x= x+1 }
Output
[1] 1
[1] 2
[1] 3
[1] 4
x=1
#print 1 to 5
repeat {
+ print(x)
+ x= x+1
+ if(x>5){
+ break
PAGE \* MERGEFORMAT 2
+ }
+ }
#Output
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
PAGE \* MERGEFORMAT 2
GOOGLE FORM
PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2
GOOGLE FORM RESPONSES
PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2
PAGE \* MERGEFORMAT 2