Hi again,
Forgive me if this is a completely silly question for rpy2. I'm trying to
wean myself from rpy, but am confused by the new approach to conversion.
If I fit a model and collect summary info as follows ...
fit = robjects.r.lm(fmla,data)
summary = robjects.r.summary(fit)
... the summary variable comes back to python as an RVector. In rpy, it
was a dictionary, so if I wanted the coefficient/t-test summary-table I
could ask (in python) for summary['coefficients']. In rpy2 it appears I
have to ask for summary[3]. That's fine (harder to remember, but fine).
However, I can't seem to access any but the first column of the table. To
get a nice table I can ...
>>> print summary[3]
Estimate Std. Error t value Pr(>|t|)
(Intercept) 10.9205792 2.9934159 3.6481997 0.001341692
prerbmt 0.4226101 0.1729016 2.4442236 0.022599474
mri -0.3495370 0.7497424 -0.4662095 0.645450898
... and if I want the estimate for the 2nd coefficient ...
>>> print summary[3][1]
0.4226101
But how do I get at the standard errors (or T-values) from python? Or is
there a better way to get at the contents of the returned results than
integer indexing?
More generally, how can one figure out what the components are for the
returned RVectors when calling R functions? The examples on the website
(nice doc, by the way!) appear to be oriented towards simply displaying
the results of R computations rather than retrieving R results for further
processing in python.
-best
Gary
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
rpy-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rpy-list