## Dummy example
## Create dataset
set.seed(10)
x<-rnorm(200,3,2)
y<-3*x+rnorm(200)
dat<-data.frame(y,x)
## Fit FKML GLD regression with 3 simulations
fit<-GLD.lm.full(y~x,data=dat,fun=fun.RMFMKL.ml.m,param="fkml",n.simu=3)
## Find median regression, use empirical method
med.fit<-GLD.quantreg(0.5,fit,slope="fixed",emp=TRUE)
fun.plot.q(x=x,y=y,fit=fit[[1]],med.fit, xlab="x",ylab="y")
if (FALSE) {
## Plot result of quantile regression
## Extract the Engel dataset
library(quantreg)
data(engel)
## Fit GLD Regression along with simulations
engel.fit.all<-GLD.lm.full(foodexp~income,data=engel,
param="fmkl",fun=fun.RMFMKL.ml.m)
## Fit quantile regression from 0.1 to 0.9, with equal spacings between
## quantiles
result<-GLD.quantreg(seq(0.1,.9,length=9),engel.fit.all,intercept="fixed")
## Plot the quantile regression lines
fun.plot.q(x=engel$income,y=engel$foodexp,fit=engel.fit.all[[1]],result,
xlab="income",ylab="Food Expense")
}
Run the code above in your browser using DataLab