Wednesday, December 5, 2018

Rank data analysis Hazaribagh


Powerpoint presentation of R script

https://www.slideshare.net/ddroy/revisiting-the-fundamental-concepts-and-assumptions-of-statistics-pps

R is a free and powerful programming language and environment for statistical computing, data exploration, data analysis and data visualization that is supported by the R Foundation for Statistical Computing. R was created by Ross Ihaka and Robert Gentleman at the University of Auckland, New Zealand. Graphics of R is useful for Data visualization. For data examination, data visualization locates the errors in data structure with respect to outliers, relations among different data sets. R allows extremely flexible use of data structure. Furthermore, R includes user friendly logical functions. R can deal with problems in a wide range of field as it has more than 75000 packages. For example,psych package is useful for examining psychometric properties of psychological instruments. The package can be downloaded from internet for temporary periods.

Download

The website is :
Cran Mirror​: https://cran.r-project.org/bin/windows/base/
R-Studio​: https://www.rstudio.com/products/rstudio/download/
Download of R is followed by the download of cran mirror.



Data analysis command (uni and bivariate)


  1. value=read.csv(choose.files(),header=T,sep=",")
  2. x=read.table(file="clipboard",header=T,sep="\t")
  3. write.table(x,file="copydata",sep="\t")
  4. write.csv(pathvalue)# writing data on the screen
  5. write.csv(pathvalue[1])# data examination
  6. write.csv(pathvalue,file="pathvalue.csv")# writing on the drive
  7. c=read.csv(file="clipboard",header=T,sep="\t")
  8. scan()
  9. readline()
  10. View(x)
  11. xx=na.omit(x)
  12. NROW(value)
  13. length(value)
  14. str(value)
  15. names(value)
  16. value[2] # name of the trainees
  17. summary(value)
  18. median(value$Age,na.rm=T)
  19. range(value$Age,na.rm=T)
  20. mean(value$Age,na.rm=T)
  21. tx=table(value$Age)
  22. xec=cut(as.numeric(value$EMOTIONAL.CONTROL),breaks = 2, labels=c("HighEC", "LOWEC"))
  23. table(xec) # highec and lowec
  24. table(value[4]) #frequency of male and female
  25. pie(table(value[4])) # multiple functions in single command
  26. boxplot(value$Age~value$Sex)
  27. xec=cut(as.numeric(value$EMOTIONAL.CONTROL),breaks = c(0,5,10,14),labels=c("high", “moderate”,”less”))
  28. wilcox.test(value$Age~agecateg)
  29. kruskal.test(value$Age~agecateg)
  30. pathvalue=data.frame(value[12:26]) # data frame of pathoriented values
  31. pathvalue[1:5,] # first 5 data of pathoriented values
  32. file.info(dir())#check the file
  33. pathvalue$EMOTIONAL.CONTROL==03# error identified
  34. cor(x,use="all.obs",method="spearman")
  35. cor(x,use="all.obs",method="kendall")
  36. Which(is.na(pathvalue[2]))
  37. sexcode=replace(x$SEX.CODE,x$SEX.CODE == "1", "male")
  38. agecode=factor(x$AGE.CODE, levels=c(1,2), labels=c("13-30","31-48>"))
  39. x=subset(patients,patients$Classification==4)

Matrix

Generally we are dealing with single dimensional data. When single dimensional data are converted into two,three or more dimensions, it becomes matrix.

xx=matrix(x$age, nrow =198,ncol =2)

Here, x$age is single dimensional data.  It becomes 2 dimensions.

Loop

for(i in 1:45) {
   
    t=(table(climate[i]))
    print(i)
    print(t)
   
}


9. data.frame(value$Name,value$Age<35,value$Age)