Exctract CI values

Posted on
Picture of user. Julia Joined: 03/29/2012
Hi.
Is it possible to extract values of upper and lower bounds of CI separately? Let's say I would like to estimate CI's for path estimates for males by introducing the following command:

ciVm = mxCI(c('am','cm','em'))

The only thing I am able to get is:

> QualACEFit@output$confidenceIntervals
lbound ubound
MZM.am[1,1] 6.128870 10.699917
MZM.cm[1,1] -7.901978 7.901978
MZM.em[1,1] 3.775610 5.115599

What I am interested in is to get, e.g., a value for the lower boud of CI for am. Is that feasible somehow?

Thank you in advance!

Replied on Fri, 09/21/2012 - 10:45
Picture of user. tbates Joined: 07/31/2009

Does this work?

QualACEFit@output$confidenceIntervals[1,1]

i.e., just access the cell in that table which you want


QualACEFit@output$confidenceIntervals[,1, drop = F] # column for row 1

Replied on Sun, 09/23/2012 - 12:12
Picture of user. mdewey Joined: 01/21/2011

An alternative to Tim's reply which is slightly more robust is to specify the element by using the names to index the matrix (assuming it is a matrix). So juliasmatrix[,"lbound"] ought to give you the first column.

More interestingly if you do
grep("am", rownames(juliasmatrix))
you should get the indexes of all rows which contain am in their name. This means that is later you ask for them in a different order you will still get the one you intended. I find this most valuable within a function which might be recycled in a different context.

Michael

Replied on Mon, 09/24/2012 - 03:45
Picture of user. Julia Joined: 03/29/2012

In reply to by mdewey

Great! Thank you so much, Tim and Michael! Both approaches give me what I wanted. I agree with you Michael that your way is a bit more robust since one does not have to search manually an index of a parameter one is interested in.

Thank you very much!