In this post i am going to show descriptive statistic example with R programming , i would like to presenting data in mean, standard deviation, maximum value, minimum value, and the last is range.
First thing i have to do is reading data. In this case, i would like to read The Sacramento crime January 2006 file contains 7,584 crime records in CSV format from this link and initialize it as a crime variable :
To see all variables name or column names used in crime data, i can use names function
To show data per column just with simple data['names'] or ‘data$columnname, when i would like to implement this crime variable for getting grid data in the variable, it will be like this data['grid'] or this data$grid
Now, i’m going to go to the topic, there are some functions to show descriptive statistics in R, they are :
mean(varname) for Mean
sd(varname) for Standard deviation
max(varname) for Maximum value
min(varname) for Minumum value
range(varname) for Range
Quite simple rigth? and now i am going to implement in on crime data,
But how to show all descriptive statistic in all column? should we type it one by one? Actually there is a summary() function for summarizing descriptive statistic for all column.
Thats at all, some way to calculate descriptive statistic with R programming, depend on me it’s very useful and amazing, hopefully it can helps beginner people in R.