Switch to full style
Examples of R Scripting Language
Post a reply

Scott knott test R Example

Wed Nov 26, 2014 7:40 pm

This example is about doing a scott-knott clustering text. The example is very simple. Just a group of factors with different importance values at ten iterations. The scott-knott will group the different factors with ranking them.

This script is written in R, a programming language and software environment for statistical computing and graphics. The script begins by loading several libraries, including "ggplot2", "grid", "plyr", "reshape" and "ScottKnott". These libraries provide various functions and tools that are used later in the script. The script then sets the working directory using the setwd() function, which is used to specify the location where R should look for files. In this case, the working directory is set to "D:/FirstPaper/FirstPaper/RQ2/". The script then reads in a CSV file called "FirefoxTimesavetable_RF.csv" using the read.csv() function and assigns the data to a variable called "dataValues". The argument "sep="," tells R to use comma as a separator. The script then uses the melt() function from the reshape library to reshape the dataframe. The function is used to reshape a dataframe from wide format to long format. The reshaped dataframe is assigned to the variable "dfm". The script then uses the aov() function to perform an Analysis of Variance (ANOVA) on the "value" column of the reshaped dataframe and "X2" column as the factor. The result is assigned to the variable "av". The script then uses the SK() function from the ScottKnott library to perform a Scott-Knott test, a non-parametric test for comparing multiple means. The function takes several arguments: the ANOVA result, the factor column, the type of dispersion and the significance level. The test results are assigned to the variab le "sk". The script then prints the results of the Scott-Knott test. The Scott-Knott test is a non-parametric method for comparing multiple means and identifying the groups that are significantly different. It is a useful method when the assumptions of parametric methods like ANOVA are not met.

Code:
require("grid")
require("plyr")
library(reshape)
library(ScottKnott)
setwd("D:/FirstPaper/FirstPaper/RQ2/")

dataValues<- read.csv('FirefoxTimesavetable_RF.csv',sep=",")

dataValues


dfm <- melt(t(dataValues))[,c(2,3)]


av <- aov(value ~ X2, data=dfm)
sk <- SK(av, which='X2',  dispersion='se', sig.level=0.05)
sk




Post a reply
  Related Posts  to : Scott knott test R Example
 Cisco 642-436 test     -  
 Microsoft 70-236 test     -  
 Examkiller Nortel 920-361 test     -  
 Free down the ST0-47X Test from Ourexam     -  
 Passcert test 000-050 exam sharing     -  
 broken latest 1D0-435 test questions     -  
 how to run inidividual test methods in junit4     -  
 Sharing Passcert ST0-058 exam test     -  
 Cisco 350-001 test exam Questions and Answers     -  

Topic Tags

R Clustering