0

I'm looking at time-series data of the GDP of the economy. I'm comparing the difference in the percent change of the GDP over the past 1 months, with the past 2 months — doing this over the course of 10 years, once for each month in the 10 years. I'm going to calculate the z-score of this difference. I want to convert the z-score that I obtain for each month in those 10 years, into a number from -1 to 1. How should I go about doing this?

Here's my thought process:

  1. I could calculate the z-score of these z-scores. I'm not completely sure how I would be able to use this though, I feel like I'd have the same issue again.
  2. I can just use the z-score as the value between -1 and 1. Whenever the z-score is >1, I set it =1. Whenever it's <-1, I set it equal to -1.
Jonathan
  • 13
  • 2
  • Soooooo... why? – Matthew Drury Aug 11 '20 at 02:20
  • I want to make a stock trading decision. If the value is, say 1, i will buy stocks with 100% of my portfolio. If it's -1, I'll sell 100% of my potfolio. If it's .5, I'll buy stocks with 50% of my portfolio... etc. Almost like a measure of confidence – Jonathan Aug 11 '20 at 02:23
  • 2
    What properties would you like the measure to have? There are an infinite number of ways to map scores to [-1, 1], and you probably don't want to stake a fortune on making one up. – Matthew Drury Aug 11 '20 at 02:24
  • The idea was, that if the percent change deviates strongly from the mean, then I'll make a bet one way or the other. So, I'm just trying to figure out how to use the z-score (measure of how many SD it is from that mean) to find an exact value for the bet - in this case, convert the z-score to a number between -1 and 1. – Jonathan Aug 11 '20 at 02:26
  • Not clear what is accomplished by transforming z score to fit into $[-1,1].$ Maybe better than your (2) is to set values below -3 to -3 and values above 3 to 3. Then divide by 3. If your data are anywhere near normal, then you'll have to "adjust" at boundaries $\pm 3$ very rarely. I did this with ten randomly simulated z-scores and rounded to 2 places, obtaining: $-0.602, -0.194,$$ -0.370, 0.338,$$ -0.054, 0.188,$$ 0.549, -0.258,$$ 0.535, -0.386.$ About 95\% of z scores will lie in $\pm 2/3.$ – BruceET Aug 11 '20 at 02:56
  • Does this answer your question? [How to reconcile z-scores into a number from -1 to 1?](https://stats.stackexchange.com/questions/482442/how-to-reconcile-z-scores-into-a-number-from-1-to-1) – mdewey Aug 11 '20 at 13:02

1 Answers1

1

Here is another, perhaps more sophisticated approach. in R, using round(2*(pnorm(z)-.5), 2) artificially adjusts nothing and spreads transformed z-scores (rounded to 2 places) uniformly in $(-1.1).$

Results from ten z-scores: $0.49, 0.99,$$ -0.03, -0.50,$$ -0.01, 0.92,$ $-0.75, 0.83.$ $0.82, 0.26.$

z = rnorm(100)
round(2*(pnorm(z)-.5), 2)
[1]  0.49  0.99 -0.03 -0.50 -0.01  0.92 -0.75  0.83  0.82  0.26

In R, pnorm is normal CDF $\Phi.$

Before rounding $\pm 3$ gets transformed to $\pm 0.997.$ Also, $\pm2$ becomes $\pm.95.$ And $\pm 1$ become $\pm .68.$

Graph of results for 10,000 z scores.

enter image description here

par(mfrow=c(2,1))
set.seed(2020)
z = rnorm(10000)
 hist(z, prob=T, col="skyblue2", main="Z ~ NORM(0,1)")
  curve(dnorm(x), add=T, lwd=2, col="red")
  abline(v=-3:3, lwd=2, lty="dotted")
u = 2*(pnorm(z)-.5)
 hist(u, prob=T, col="skyblue2", main="Transformed to (-1,1)")
  curve(dunif(x,-1,1), add=T, lwd=2, col="red")
   abline(v=c(-.997,-.95,-.68,0,.68,.95,.997), lwd=2, lty="dotted")
par(mfrow=c(1,1)) 
BruceET
  • 47,896
  • 2
  • 28
  • 76
  • 2
    If anyone is wondering why this works, it's because the CDF of a random variable is uniformly distributed. https://stats.stackexchange.com/questions/161635/why-is-the-cdf-of-a-sample-uniformly-distributed – Sycorax Aug 11 '20 at 04:25