I have this data.frame:
df <- data.frame(a=rnorm(500),b=rnorm(500),c=rnorm(500),
d=rnorm(500),e=rnorm(500),f=rnorm(500),g=rnorm(500))
And i run quantile regression:
library(quantreg)
a<-rq(a~g,tau = 0.5,method="br",data=df)
summary.rq(a)
b<-rq(b~g,tau = 0.5,method="br",data=df)
summary.rq(b)
c<-rq(c~g,tau = 0.5,method="br",data=df)
summary.rq(c)
d<-rq(d~g,tau = 0.5,method="br",data=df)
summary.rq(d)
e<-rq(e~g,tau = 0.5,method="br",data=df)
summary.rq(e)
f<-rq(f~g,tau = 0.5,method="br",data=df)
summary.rq(f)
g<-rq(g~g,tau = 0.5,method="br",data=df)
summary.rq(g)
For example:
summary.rq(a)
Call: rq(formula = a ~ g, tau = 0.5, data = df, method = "br")
tau: [1] 0.5
Coefficients:
coefficients lower bd upper bd
(Intercept) 0.12940 0.04870 0.17940
g -0.02131 -0.08078 0.05370
I want to build a matrix like this:
Matrix.Parameters.Interval<-matrix(0,7,6)
the first line will be related to the first model. In the first column goes the intercept parameter the 2º and 3º column its confidence interval(that I will extract from the summary
output), 4º column the variable parameter, and in the 5º and 6º column its interval (that I will extract from the summary
output)