R programming statistics example

A PHP Error was encountered

Severity: Warning

Message: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.

Filename: blog/post_details.php

Line Number: 38

Backtrace:

File: /home/solutio1/public_html/application/views/blog/post_details.php
Line: 38
Function: strtotime

File: /home/solutio1/public_html/application/controllers/Blog.php
Line: 14
Function: view

File: /home/solutio1/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.

Filename: blog/post_details.php

Line Number: 38

Backtrace:

File: /home/solutio1/public_html/application/views/blog/post_details.php
Line: 38
Function: date

File: /home/solutio1/public_html/application/controllers/Blog.php
Line: 14
Function: view

File: /home/solutio1/public_html/index.php
Line: 315
Function: require_once

2019-09-06
Manoj Pawar

In R statistical analysis can be determined by using many in-built function.These in-built function takes R vector as an input along with no of argument and gives us result.

We are discussing These function i.e mean,median,trim.

  •  Mean:

Mean calculated by using taking sum of values and divide it with number of values .

Formula:

Mean(X,trim=0,na.rm=FALSE,…)

Description:

X: is a input vector

Trim: is used to drop some observation from both end of vector.

Na.rm: is used to remove missing value from the input vector.

> x<-c(-2,-3,-3,5,6,78,30,54)
> print(x)
[1] -2 -3 -3  5  6 78 30 54
> y<-mean(x) //We are calculating mean of x and stored into y variable.
> print(y)
Output:
[1] 20.625

 

  •  Median:

Median shows the middle value in data series.And it can calculated by using median() function.

Formula:

Median(X,na.rm=FALSE)

Description:

X:is a input vector.

Na.rm:is used to remove missing value from the input vector.

> x<-c(-2,-3,-5,5,3,8,34,24) 
> print(x)
[1] -2 -3 -5  5  3  8 34 24 
> y<-median(x)
> print(y)
Output:
[1] 4
  •  Trim:    

  it is used to drop observation from both end of  vector.when trim argument is supplied.the value of vector get sorted.For example:when trim=0.3, it will drop some observation from both end of sorted vector.i.e supposed x is a sorted vector containing some values

x<-c(-21,3.0,4.0,5.0,6.7,8.9,9.5,16.5)

and values removed from  sorted vector (-21,3.0,4.0) from the left and from the right (8.9,9.5,16.5).  

> x<-c(-2,-3,-5,5,7,78,34,32)
> result<-mean(x,trim=0.3)
> print(result)
output:
[1] 10.5

 

 

 

 

 

 

 


About author

Card image cap
Manoj Pawar

I am data analyst and show you how visualization done using R language.!

-Data Analyst

0 Comments