rhoScale {ResearchMethods}R Documentation

Scaling and Shifting rho calculations

Description

Using a graphical user interface (GUI), this function demonstrates the effect of scaling and shifting a dataset has on its correlation, rho, and its inter-class correlation, icc, on another dataset.

Usage

  rhoScale(x,y,gui=TRUE,sc=1,sh=0,xlab='x',ylab='y')

Arguments

x,y The two variables from which the correlation is calculated, used as the x and y axes respectively in the plot.
gui An indicator of whether the interface should be activated.
sc The initial scaling value.
sh The initial shiting value.
xlab,ylab What to label the plots with.

Details

This function produces one or two windows. The Tk window, which only appears if gui=T produces two sliders to manipulate the plot window. Scale has a range of [0.1, 5] and is the multiplier on the x-variable, labeled a (see below). Shift has a range of 25% of the data range, about the mean, and is the shift on the x-variable, labeled b (see below).

The second window is a plotting window, featuring two scatterplots. The first, the black plot, is of the original data, of the form y = x, with a line of best fit through it. The second, the red plot, is the data shifted and scaled, of the form Y = aX + b.

Value

No meaningful value is returned, this function is run only for its plotting functions. The variable RSenv is left behind so the variables used in the plotting function may be maniuplated.

Note

This program was written on Ubuntu Linux 7.0.4. Though it should work on all operating systems, because of its use of Tcl/Tk it is only guarenteed on Linux. Any problems with the GUI should be checked against the Tcl/Tk documentation.

The function was designed to work with the GUI. The ability to plot without it was added to allow the function to be embedded into other programs such as Sweave. Whenever possible, it is better to use the GUI controls.

Author(s)

Mohamed Abdolell <mohamed.abdolell@dal.ca> and Sam Stewart <samstewart11@gmail.com>

References

This plot was designed for a course by Mohamed Abdolell

See Also

rhoRange

Examples

  # two simple examples
  data("MFSV")
  rhoScale(MFSV$MF,MFSV$SV)
  data("agpop")
  rhoScale(agpop[,6],agpop[,7])

  # working without the GUI
  rhoScale(MFSV$MF,MFSV$SV,gui=FALSE,sc=2,sh=25)

[Package ResearchMethods version 1.01 Index]