Dear Community:
My objective is to generate a list of T-scores, by observation, for a simple data set of variable "X" observations (n=13). The issue is that I cannot find a command to create a table of generated T-scores for each individual observation.
For greater clarity, I want to write SAS code to calculate a T score for each observation using the z score and that formula is T = (Z x 10) + 50.
*Build raw data table for 13 provided observations;
DATA HW2;
INPUT X;
DATALINES;
43
42
40
39
38
37
36
24
28
22
18
16
10
;
RUN;
I transformed the X observations into z-scores and generated a new dataset "zHW2" (see below).
*Transform the X scores into z-scores;
PROC STANDARD data=HW2 Mean=0 STD=1 Out=zHW2;
VAR X;
RUN;
Now I would like to compute the T scores and generate a revised dataset labeled "tHW2."
Thank you.
Thanks for the clarification. As shown in my previous post, you can compute the T scores directly from dataset HW2 without an intermediate step. But it's not too difficult to use zHW2 either:
data tHW2;
set zHW2;
T=10*X+50;
run;
According to https://stattrek.com/statistics/dictionary.aspx?definition=T_score, there are more than one definition of t-score. Which is the one you intend? If it is the one attributed to psychometrics, just do a OUT= to generate the z-score and calculate t-score from that.
PROC TTEST does not produce results for individual observations. It produces hypothesis tests about the mean and the variance.
If you want a "T-score", you need to define it clearly for us, as I agree with @mkeintz, it is not clear what you are asking for. If it is what I am thinking, you could obtain this via data step coding along with the output (mean and standard deviation) from PROC MEANS/PROC SUMMARY.
Thank you @mkeintz and Paige...both responses make sense. The statistical procedure fact, which I inadvertently overlooked while immersed in learning codes, is that the t-test doesn't derive T scores by individual observation. Thus, the procedural inability to create a revised output file. My apologies and thank you again for clarifying my understanding.
Even though it is not a typical solution, you should mark your last contribution to this topic as the solution. That way, folks looking for unsolved topics won't spend unnecessary time.
Hi @jrossgilbert,
Have you tried PROC STANDARD or PROC STDIZE? These procedures can compute a variety of scores for individual observations, for example the psychometric t-scores that have been mentioned:
proc standard data=hw2 mean=50 std=10 out=thw2;
run;
proc stdize data=hw2 add=50 mult=10 out=thw2a oprefix sprefix=t_;
var x;
run;
For greater clarity, I want to write SAS code to calculate a T score for each observation using the z score and that formula is
T = (Z x 10) + 50.
I transformed the X observations into z-scores and generated a new dataset "zHW2" (see below).
*Transform the X scores into z-scores;
PROC STANDARD data=HW2 Mean=0 STD=1 Out=zHW2;
VAR X;
RUN;
My last objective is to generate the computed T scores, by observation, in a new data set labeled "tHW2."
Thanks for the clarification. As shown in my previous post, you can compute the T scores directly from dataset HW2 without an intermediate step. But it's not too difficult to use zHW2 either:
data tHW2;
set zHW2;
T=10*X+50;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.