Total members 11890 |It is currently Mon May 20, 2024 5:33 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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




_________________
Sami
PHD student - SAIL - School Of Computing
Queens' University
Canada


Author:
Site Admin
User avatar Posts: 33
Have thanks: 1 time
Post new topic Reply to topic  [ 1 post ] 

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



Topic Tags

R Clustering






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com