Exctract CI values
Posted on

Forums
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!
index into the result table
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
Log in or register to post comments
An alternative to Tim's reply
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
Log in or register to post comments
In reply to An alternative to Tim's reply by mdewey
Great! Thank you so much, Tim
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!
Log in or register to post comments