Skip to content
Back to formatted view

Raw Message

Message-ID: <D8F58373-E5A5-4668-9ACD-832984956577@gmail.com>
Date: 2011-12-05T12:55:45Z
From: michael.weylandt at gmail.com (R. Michael Weylandt
Subject: extract cov matrix in summary.rq and use as a matrix.
In-Reply-To: <SNT140-W861B3D2EE1BDB52A5855FD1B50@phx.gbl>

I'm not at my desk so this is untested, but I'm pretty sure double brackets will do the trick:

qf2_1[[3]]

M 

On Dec 5, 2011, at 7:14 AM, Julia Lira <julia.lira at hotmail.co.uk> wrote:

> 
> Dear all,
> 
> I need to extract the covariance matrix of my quantile regression estimation to use in a test. My regression is:
> 
> qf2_1 <- summary(rq(wb2 ~ apv2 + vol2, tau = phi2[1]), cov = TRUE)
> 
> I can extract the covaraince matrix by using: qf2_1 [3]. However, if I try to use it in the test, it does not work. I only need to transform qf2_1[3] in a matrix 3x3. I have already tried: matrix(qf2_1[3], nrow=3, ncol=3) but it also does not work. By using the latter, I find:
>     [,1]      [,2]      [,3]     
> [1,] Numeric,9 Numeric,9 Numeric,9
> [2,] Numeric,9 Numeric,9 Numeric,9
> [3,] Numeric,9 Numeric,9 Numeric,9
> 
> Is there any other way to do it?
> 
> Thanks a lot in advance!
> 
> All the best,
> 
> Julia
> 
> 
> 
> 
> 
> 
>                         
>    [[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.