0% found this document useful (0 votes)
33 views

Pallavi BRM File

Brm file

Uploaded by

Xeroscee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Pallavi BRM File

Brm file

Uploaded by

Xeroscee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 29

Practical Lab File

On
“BUSINESS RESEARCH METHODOLOGY”

Submitted for the partial fulfilment of the degree of the


“Bachelor of Business Administration”
(2023-2026)

Management Education and Research Institute


Affiliated To Guru Gobind Singh Indraprastha University
Sector 16-C, Dwarka, New Delhi

Supervised By Submitted By
Dr. Simranjeet Kaur Bagga Name- Pallavi Sharma
Assistant Professor Roll No.70915101723
MERI

1
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 bonafide
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 fulfilment of the task are genuine and original
to the best of my knowledge & amp; I have not submitted it earlier elsewhere.

Signature
Pallavi Sharma
BBA, 3rd (semester)
Enrolment No: 23MER0577
Roll no. 70915101723

2
INTERNAL GUIDE CERTIFICATE
To whomsoever it may concern

This is to certify that the practical lab file work “Business Research Methodology” made by
Pallavi Sharma, BBA, 3rd Semester 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 fulfilment of the degree
of Bachelor of Business Administration.

Dr. Simranjeet Kaur Bagga


(Internal Supervisor)

3
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 Indraprastha 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
Pallavi Sharma
BBA, 3rd (semester)
Enrolment No: 23MER0577
Roll no. 70915101723

4
TABLE OF CONTENTS

S.No. Title Page Signature


no.
1. Introduction to R 6-10
2. Write a R program to take input from the user such as name 11
and age and print their value. Also join name and age and
print their values.
3. Write R Program to include all Data Types. 12-13
4. Write a R program to illustrate the usage of all arithmetic, 14-16
logical and relational operators with two vectors.
5. Write a R program to find out the descriptive statistics value 17-18
of numeric vector through specified length of 5.
6. Write a R program to create a matrix of both numeric and 19-21
character to assess and modify.
7. Write a R program to Create a list using Numeric and 22-24
Character vectors in R. Access and modify it also and merge
also.
8. Write a R program to create a data frame, merge two data 25-26
frame also.
9. Write a R program for loop statement such as if, elseif, for 27-29
and while and break statement.

5
Introduction to R Studio

R is a popular programming language and software environment for statistical computing and
graphics. Developed in the 1990s by Ross Ihaka and Robert Gentleman, R is widely used by data
analysts, data scientists, researchers, and academics for data analysis, visualization, and
modeling.

1.1 Advantages of R

1. Free and Open-Source: R is free to download and use, with a large community contributing to
its development and maintenance.

2. Extensive Libraries: R has an vast array of libraries (over 18,000 packages) for various tasks,
including data visualization, machine learning, and statistical modeling.

3. Data Visualization: R provides excellent data visualization capabilities through libraries like
ggplot2, Shiny, and plotly.

4. Statistical Analysis: R offers a wide range of statistical techniques, including hypothesis


testing, regression, time series analysis, and survey analysis.

5. Community Support: R has a massive and active community, ensuring there are numerous
resources available for learning and troubleshooting.

6. Cross-Platform Compatibility: R runs on Windows, macOS, and Linux.

7. Dynamic Graphics: R allows for interactive and dynamic graphics.

1.2 Disadvantages of R

6
1. Steep Learning Curve: R requires programming knowledge and can be challenging for
beginners.

2. Slow Performance: R can be slower than other programming languages, especially with large
datasets.

3. Memory-Intensive: R requires significant memory, which can lead to performance issues.

4. Limited Support for Parallel Processing: R's parallel processing capabilities are limited,
making it less suitable for massive computations.

5. Not Ideal for Real-Time Applications: R is primarily design ed for batch processing and may
not be the best choice for real-time applications.

1.3 R. Studio

RStudio 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 R Studio

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 untl you tell it to run; this allows you the
flexibility to work at your own pace, as well as to save your work.

7
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.

The upper-right quadrant contains the Environment and History tabs. The Environment tab
displays a list of all the data objects that you havae 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 visualzations you have created in your current R session. The “Packages” tabs shows a list of
all the packages currently installed, as well as an indication of whther 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.

LS

- ls(): Lists all objects in the current R environment.

Ls.Str

8
- ls.str(): Lists all objects in the current R environment, along with their structure.

rm

- rm(): Removes objects from the current R environment.

Class

- class(): Returns the class of an object.

Vector

In R, a vector is a one-dimensional array of elements of the same data type, such as numbers,
characters, or logical values. Vectors are the most basic data structure in R and are used to store
and manipulate data.

Matrix

A matrix is a two-dimensional array of elements of the same data type, with rows and columns.

List in R

A list is a collection of objects of different data types, including vectors, matrices, data frames,
and other lists.

Data Frame in R:

9
A data frame is a two-dimensional table of data with rows (observations) and columns
(variables). Each column contains data of one type (numeric, character, etc.), and each row
represents a single observation.

Loop Statements in R:

Loop statements are used for repetitive execution of code.

Types of loops:

1. For Loop: Iterate over a sequence (vector, list, etc.)

2. While Loop: Execute code while a condition is true

3. Repeat Loop Similar to while loop but checks condition after execution in R.

10
Practical No. 1

Write a R program to take input from the user such as name and age and
print their value. Also join name and age and print their values.

#Create a name and age value

> Name="Pallavi Sharma"

> Age= 19

> print(Name)

[1] "Pallavi Sharma"

> print(Age)

[1] 19

> # Join the name and the age.

> paste("My name is",Name,"and my age is",Age)

# Output

[1] "My name is Pallavi Sharma and my age is 19"

11
Practical No. 2

Write R Program to include all Data Types.

> #Create a numeric vector

> b=c(1,2,3,4,5,6)

> print(b)

Output

[1] 1 2 3 4 5 6

> #create a complex vector

> x=c(0+0i+0+0i+0+0i)

> print(x)

Output

[1] 0+0i

> #create a logical vector

> z=c(TRUE,FALSE,TRUE,FALSE,TRUE,FALSE)

> print(z)

Output

[1] TRUE FALSE TRUE FALSE TRUE FALSE

> #Create a character vector

>k=c("apple","mango","grapes","orange","strawberry","pinapple")

> print(k)

Output

12
[1] "apple" "mango" "grapes" "orange" "strawberry" "pinapple"

13
Practical No. 3

Write a R program to illustrate the usage of all arithmetic, logical and


relational operators with two vectors.

# arithmetic operator.

> vect1=c(0,2)

> vect2=c(2,3)

> paste("Addition")

[1] "Addition"

> a=vect1+vect2

> print(a)

Output

[1] 2 5

> paste("Subtraction")

[1] "Subtraction"

> b=vect1-vect2

> print(b)

Output

[1] -2 -1

> paste("Multiplication")

[1] "Multiplication"

14
> c=vect1*vect2

> print(c)

Output

[1] 0 6

> paste("Division")

[1] "Division"

> d=vect1/vect2

> print(d)

Output

[1] 0.0000000 0.6666667

# Logical operator

> vect1=c(0,2)

> vect2=c(2,3)

Equal

> print(paste("Equal",vect1==vect2))

Output

[1] "Equal FALSE" "Equal FALSE"

Not Equal

> print(paste("Not Equal",vect1=vect2))

Output

[1] "Not Equal 2" "Not Equal 3"

Greater than

15
> print(paste("Greater than",vect1>vect2))

Output

[1] "Greater than FALSE" "Greater than FALSE"

Less than

> print(paste("Less than",vect1<vect2))

Output

[1] "Less than TRUE" "Less than TRUE"

#Relational operators

vect3=c(10,20,30,40,50)

> vect4=c(5,10,15,20,25)

AND

> print(paste("AND",(vect3>20)&(vect4<20)))

Output

[1] "AND FALSE" "AND FALSE" "AND TRUE" "AND FALSE" "AND FALSE"

OR

> print(paste("OR",(vect3>20)/(vect4<20)))

Output

[1] "OR 0" "OR 0" "OR 1" "OR Inf" "OR Inf"

NOT

> print(paste("NOT",(vect3>20)))

Output

[1] "NOT FALSE" "NOT FALSE" "NOT TRUE" "NOT TRUE" "NOT TRUE"

16
Practical No.4

Write a R program to find out the descriptive statistics value of numeric


vector through specified length of 5.

> # Create a numeric vector of length 5.

> x=c(10,20,30,40,50)

> # Calculate descriptive statistics

#Mean

> mean(x)

Output

[1] 30

> #Median

> median(x)

Output

[1] 30

> #Minimum

> min(x)

Output

[1] 10

> #Maximum

> max(x)

17
Output

[1] 50

> #Sum

> sum(x)

Output

[1] 150

> #Length

> length(x)

Output

[1] 5

18
Practical No.5

Write a R program to create a matrix of both numeric and character to assess


and modify.

# Create a matrix in numeric

> a=c(1,2,3,4,5,6,7,8,9)

> matrix1=matrix(a,nrow=3,ncol=3,byrow=TRUE)

> #Accessing the element

> matrix1[2,2]

[1] 5

> print(matrix1)

Output

[,1] [,2] [,3]

[1,] 1 2 3

[2,] 4 5 6

[3,] 7 8 9

> paste("new matrix :",matrix1)

[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"

[9] "new matrix : 9"

> #Modifying the element

19
> matrix1[2,2]=100

> print(matrix1)

Output

[,1] [,2] [,3]

[1,] 1 2 3

[2,] 4 100 6

[3,] 7 8 9

> #Create a matrix in character.

> a=matrix(c("A","B","C","D","E","F","G","H","I"),nrow=3,ncol=3,byrow=TRUE)

> print(a)

Output

[,1] [,2] [,3]

[1,] "A" "B" "C"

[2,] "D" "E" "F"

[3,] "G" "H" "I"

> #Accessing the Specific element

> print(a[2,3])

Output

[1] "F"

> #Modifying the Specific element.

> a[1,1]<-"x"

> a[2,3]<-"y"

20
> print(a)

Output

[,1] [,2] [,3]

[1,] "x" "B" "C"

[2,] "D" "E" "y"

[3,] "G" "H" "I"

21
Practical No. 6

Write a R program to Create a list using Numeric and Character vectors in R.


Access and modify it also and merge also.

# Create the list in numeric and character.

> ls=list(c(1,2,3,4), list("a","b","c","d"))

> print(ls)

Output

[[1]]

[1] 1 2 3 4

[[2]]

[[2]][[1]]

[1] "a"

[[2]][[2]]

[1] "b"

[[2]][[3]]

[1] "c"

22
[[2]][[4]]

[1] "d"

> print(class(ls))

[1] "list"

> # Merging the list

> list1=list("a","b","c","d")

> list2=list(c(1,2,3,4))

> #Merging the two list

> mergelist=c(list1,list2)

> print(mergelist)

Output

[[1]]

[1] "a"

[[2]]

[1] "b"

[[3]]

[1] "c"

[[4]]

[1] "d"

23
[[5]]

[1] 1 2 3 4

24
Practical No. 7

Write a R program to create a data frame, merge two data frame also.

#Create a Vector

Employeeid= c(101,102,103)

Name=c(“Radha”, “Krishna”, “Vikram”)

Salary=c(400000, 200000, 100000)

#Create a dataframe of vector

df1=data.frame(Empoyeeid, Name, Salary)

print(df1)

Department=c(“Operation”, “Production”, “HR”)

df2=data.frame(Department)

print(df2)

#bind the dataframe

y=cbind(df1,df2)

print(y)

#Output

[1] Emolyeeid Name Salary

1 101 Radha 400000

2 102 Krishna 200000

3 103 Vikram 100000

25
[2] Department

1 Operation

2 Production

3 HR

[3] Emolyeeid Name Salary Department

1 101 Radha 400000 Operation

2 102 Krishna 200000 Production

3 103 Vikram 100000 HR

26
Practical No. 8

Write a R program for loop statement such as if, elseif, for and while and
break statement.

>#Check whether the value of x is positive, negative or zero.

>X=0

>if(x<0){

print(x)

>if(x<0){

Print(x” is a negative number”)

} else if(x>0){

Print(x,”is a positive number”)

}else{

Print(“Zero”)

Output

[1]”Zero

> #for loop statement

> x=letters[4:10]

> for(i in x) {print(i)}

[1] "d"

27
[1] "e"

[1] "f"

[1] "g"

[1] "h"

[1] "i"

[1] "j"

> #while loop statement

> x=1

> #print 1 to 5

> while (x<=4) { print (x)

+ x= x+1 }

Output

[1] 1

[1] 2

[1] 3

[1] 4

> #Repeat loop and break statement

> x=1

> #print 1 to 5

> repeat {

+ print(x)

+ x= x+1

+ if(x>5){

28
+ break

+ }

+ }

Output

[1] 1

[1] 2

[1] 3

[1] 4

[1] 5

29

You might also like