# Re: [R] partial R

From: Pedram Rowhani <rowhani_at_geog.ucl.ac.be>
Date: Mon 02 Apr 2007 - 15:05:32 GMT

Dear John and Michael,

sorry for the poor explanation of my question.

What I am looking for is the partial R-squares, to estimate the proportion of unexplained variation of y that becomes explained with the addition of variable x
cr.plots does give me the plots but I am looking for a way to get the actual partial R squares, which would correspond to the R squares of those plots

I hope that things are a bit more clear now

I guess I can calculate the SSE's and SSR's of the different models myself and then use the formula for partial R square but things would be just simpler if there was already a function implemented in R

Thanks again
Pedram

At 16:20 02/04/2007, John Fox wrote:
>Dear Michael and Pedram,
>
>I'm afraid that Pedram's question is unclear, since the subject line refers
>to "partial R" (which might have been intended as "partial r," or "partial
>correlation"), while the message itself refers to "partial regression
>coefficients."
>
>The latter are simply the coefficients returned by lm(); there is a
>partial.cor() function in the Rcmdr package that computes partial
>correlations. It's so simple, that I'll just reproduce it here:
>
>partial.cor <-
>function (X, ...)
>{
> R <- cor(X, ...)
> RI <- solve(R)
> D <- 1/sqrt(diag(RI))
> R <- -RI * (D %o% D)
> diag(R) <- 0
> rownames(R) <- colnames(R) <- colnames(X)
> R
>}
>
>cr.plots() in the car package produces partial-residual plots
>("component+residual plots") but returns neither partial correlations nor
>partial-regression coefficients.
>
>Regards,
> John
>
>--------------------------------
>John Fox
>Department of Sociology
>McMaster University
>Hamilton, Ontario
>905-525-9140x23604
>http://socserv.mcmaster.ca/jfox
>--------------------------------
>
> > -----Original Message-----
> > From: r-help-bounces@stat.math.ethz.ch
> > [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Michael Kubovy
> > Sent: Monday, April 02, 2007 9:16 AM
> > To: Pedram Rowhani
> > Cc: r-help@stat.math.ethz.ch
> > Subject: Re: [R] partial R
> >
> >
> > On Apr 2, 2007, at 5:49 AM, Pedram Rowhani wrote:
> >
> > > i am wondering if there is a command in R that will give me the
> > > partial regression coefficients
> >
> > RSiteSearch('partial regression')
> >
> > It's then likely that you would figured out that one way to proceed is
> > install.packages('car')
> > ?cr.plots
> >
> > (You may have to restart R to get the help on a newly-installed
> > package.)
> > _____________________________
> > Professor Michael Kubovy
> > University of Virginia
> > Department of Psychology
> > USPS: P.O.Box 400400 Charlottesville, VA 22904-4400
> > Parcels: Room 102 Gilmer Hall
> > McCormick Road Charlottesville, VA 22903
> > Office: B011 +1-434-982-4729
> > Lab: B019 +1-434-982-4751
> > Fax: +1-434-982-4766
> > WWW: http://www.people.virginia.edu/~mk9y/
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >

Pedram Rowhani Ardekani
University of Louvain
Department of geography
Place Louis Pasteur, 3
1348 Louvain-la-Neuve (Belgium)

```tel     (+32) 010/47.28.70
fax     (+32) 010/47.28.77
e-mail  rowhani@geog.ucl.ac.be
```

http://www.geo.ucl.ac.be/Recherche/Teledetection/index.html

[[alternative HTML version deleted]]

R-help@stat.math.ethz.ch 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 Tue Apr 03 01:13:37 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 02 Apr 2007 - 16:30:35 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.