[R] Zeta-squared transformation use R?

jlh.membership jlh.membership at gmail.com
Sun Jul 13 19:14:53 CEST 2014


Hi Miles,

If I read the paper correctly, zeta-squared is simply: (1+z^2) for z>=0, and 1/(1+z^2) for z<=0, where z is the z-score (Eqn. 11 in the paper). Z-scores can be calculated in R using the scale(...) function. So this should produce a zeta-squared transformation.

zeta.sq <- function(data) {
  z.sq    <- scale(data)^2
  zeta.sq <- ifelse(z.sq>0,1+z.sq,1/(1+z.sq))
}

Simple example: 100 respondents, 3 questions. First question scored on (1,7), second question scored on (-10,10), third question scored on (0,100) in 0.01 increments.

set.seed(1)    # for reproducible example
df <- data.frame(Q1=sample(1:7,100,replace=T),
                 Q2=sample(-10:10,100,replace=T),
                 Q3=sample(seq(0,1,len=101),100,replace=T))
# transform the data...
result <- zeta.sq(df)

Regards,

John Howard
Prism Marketing Group
http://www.prismmg.com


-----Original Message-----
From: Miles Yang [mailto:miles2yang at gmail.com] 
Sent: Saturday, July 12, 2014 7:31 AM
To: Jeff Newmiller
Cc: r-help at r-project.org
Subject: Re: [R] Zeta-squared transformation use R?

Hi Jeff,

Yes, I searched that but it comes out "zeta-squared coefficient" instead of transformation method.

I hope if there is someone have the experience in applying "zeta-squared transformation" in R?

Appreciate any help on this.

Regards,
miles


On Sat, Jul 12, 2014 at 4:01 PM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us>
wrote:

> Have you tried
>
> RSiteSearch("zeta squared")
>
> ?
>
> Someone may recognize this, but it never hurts to communicate where 
> you have already looked.
>
> ---------------------------------------------------------------------------
> Jeff Newmiller                        The     .....       .....  Go Live...
> DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live
> Go...
>                                       Live:   OO#.. Dead: OO#..  Playing
> Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
> /Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
> ----------------------------------------------------------------------
> ----- Sent from my phone. Please excuse my brevity.
>
> On July 11, 2014 9:44:43 PM PDT, Miles Yang <miles2yang at gmail.com> wrote:
> >Hi R-helpers,
> >
> >Is there any packages can do "*zeta-squared transformation*"?
> >
> >The Zeta-squared transformation comes from the following article:
> >Standardizing Variables in Multiplicative Choice Models Lee G. Cooper 
> >and Masao Nakanishi Journal of Consumer Research, Vol. 10, No. 1 
> >(Jun., 1983), pp. 96-108
> >
> >Thanks for any help in advance.
> >
> >miles
>
>


--
------------------
Miles Yang
Mobile:+61-411-985-538
E-mail:miles2yang at gmail.com
Web: Miles Yang Website <https://sites.google.com/site/miles2yang/>
------------------

	[[alternative HTML version deleted]]



More information about the R-help mailing list