Total members 11644 |It is currently Tue Jun 27, 2017 3:09 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Building a Quantile regression model in R script. Following example show the quantile regression at different quantile values (10%, 25%, 50%, .. 100%). Quantile regression model is important to understand the role of your model varriables along the different percentiles of your data.
Code:
require(foreign) 
require(ggplot2)
require(
MASS)
require(
boot)
# data for analysis model.
data <- read.csv("Model14.csv",head=TRUE );
# attach data
attach(data)
# Define variables
<- cbind(dupdifftriage3)
<- cbind(descriptiontextcount, titletextcount, priority_val, comment_count, cc_count,repoter_rep,bug_severity_num)
<- cbind(titletextcount)
library(quantreg)

# Quantile regression
quantreg10 <- rq(~ X, data=data, tau=0.1)
summary(quantreg10)
quantreg25 <- rq(~ X, data=data, tau=0.25)
summary(quantreg25)

quantreg50 <- rq(~ X, data=data, tau=0.5)
summary(quantreg50)

quantreg75 <- rq(~ X, data=data, tau=0.75)
summary(quantreg75)
quantreg90 <- rq(~ X, data=data, tau=0.90)
summary(quantreg90)
# Simultaneous quantile regression
quantreg2575 <- rq(~ X, data=data, tau=c(0.1, 0.95))
summary(quantreg2575)

# ANOVA test for coefficient differences
anova(quantreg25, quantreg75)

# Plotting data
quantreg.all <- rq(log(Y+1) ~ X, tau = seq(0.05, 0.95, by = 0.05), data=data)
quantreg.plot <- summary(quantreg.all)
plot(quantreg.plot)
 

quantreg
.all <- rq(log(Y+1) ~ z, tau = seq(0.05, 0.95, by = 0.05), data=data)
quantreg.plot <- summary(quantreg.all)
plot(quantreg.plot)





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


Author:
Site Admin
User avatar Posts: 33
Have thanks: 1 time

updated.

_________________
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  [ 2 posts ] 

  Related Posts  to : Building Quantile regression in R
 need help building table in my database!     -  



Topic Tags

R Analysis
cron






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team