"Simple way to get Descriptive statistic for all data points in R"
In Data analysis, descriptive statistics plays a very important role to summarize large amounts of data, so it is easy to interpret them. Descriptive statistics does not aim to reach any conclusion or prove a hypothesis. Its aim is to present a condensed form of data.
There is a package in R called "‘pastecs", which gives a descriptive statistics if a data set using simple command.
Lets looks, what data looks like for class A and class B
## Code to impor CSV File in R, and view it.
## replace the path of file and file name as per your requirement
Student_Data <- read.csv(file="C:\\Users\\swana\\Desktop\\R Code\\students.csv", header=TRUE, sep=",")
View (Student_Data)
To obtain descriptive statistics for all observations, just us, the following code.
## digits = 2 will round off the output data to 2 decimals
## actual data resides in column 2 and 3, hence [2:3]
options(digits=2)
Des_Sta <- stat.desc(Student_Data[2:3])
View(Des_Sta)
Hope you find this article useful, do let me know your thoughts on the same.