Re: [R] extracting Pr>ltl from robcov/ols (Design)

From: Frank E Harrell Jr <f.harrell_at_vanderbilt.edu>
Date: Fri, 25 Jul 2008 11:41:15 -0500

Mark Difford wrote:

> ldb (?),
> 

>>> I am trying to extract significance levels out of a robcov+ols call....
>>> However, I can't figure out how to get to the significance (Pr>ltl).
>>> It is obviously calculating it because the call:
> 
> It's calculated in print.ols(). See extract below. To see the whole
> function, do
> 
> print.ols
> 
> ## Extract from print.ols in package Design
> se <- sqrt(diag(x$var))
>     z <- x$coefficients/se
>     P <- 2 * (1 - pt(abs(z), rdf))
>     co <- cbind(x$coefficients, se, z, P)
>     dimnames(co) <- list(names(x$coefficients), c("Value", "Std. Error", 
>         "t", "Pr(>|t|)"))
>     print(co)
> 
> HTH, Mark.

In addition to what Mark said, note that it is usually an accident when a variable has only one degree of freedom in the model. So in general you might use the matrix that is output by anova.Design.

Frank

> 
> 
> ldb-5 wrote:

>> I am trying to extract significance levels out of a robcov+ols call.
>>
>> For background: I am analysing data where multiple measurements(2 per
>> topic) were taken from individuals(36) on their emotional reaction
>> (dependent variable) to various topics (3 topics). Because I have
>> several emotions and a rotation to do on the topics, I'd like to have
>> the results pumped into a nice table.
>>
>> answer<-robcov(ols(emotion ~ topic,x=TRUE,y=TRUE),individual)
>>
>> >From the robcov help it warns me:
>>
>>> Adjusted ols fits do not have the corrected standard errors printed with
> print.ols. Use sqrt(diag(adjfit$var)) to get this, where adjfit is the
> result of robcov.

>> So I can get to the standard error by:
>>
>> answer.se<-sqrt(diag(answer$var))
>>
>> I can get to the coefficients by:
>>
>> answer.co<-coefficients(answer)
>>
>> I can get to the t-values by:
>>
>> answer.t<-coefficients(answer)/ sqrt(diag(answer$var))#t-value
>>
>> However, I can't figure out how to get to the significance (Pr>ltl).
>> It is obviously calculating it because the call:
>>
>> answer
>>
>> provides it, but I can't figure out where it is getting it from or how
>> it is calculating.
>>
>> thanks for any help.
>>
>> ldb
>>
>> ______________________________________________
>> 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.
>>
>>
>
-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University

______________________________________________
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.
Received on Fri 25 Jul 2008 - 16:44:20 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 25 Jul 2008 - 17:32:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive