04-19-2017 10:58 PM
I'm trying to run a t-test and I can't get SAS to recognize a generated transposed variable. I also don't know why it generated two of the same columns. When I attempt to rename or drop it, it gives the same error message as well:
ERROR: Variable LABEL_OF_FORMER_VARIABLE not found.
Is there a way to create the same column or copy it again so that SAS will be able to analyze it? I would REALLY appreciate any help on this because I've been stuck on this problem for days! Attached a screenshot.
04-19-2017 11:09 PM
04-19-2017 11:40 PM
You're seeing the variable LABEL not the variable NAME.
I would guess the variable name is actually _LABEL_ but verify it either by switching to the variable name (in View Menu) or using PROC CONTENTS.
04-19-2017 11:41 PM
This is in addition to @Jagadishkatam correct statement that the VAR requires a numeric variable. The variable to be analyzed goes in the VAR statement, the categorical variable goes as the CLASS variable.
04-19-2017 11:43 PM
"NAME OF FORMER VARIABLE" and "LABEL OF FORMER VARIABLE" are variable labels, not names. The corresponding variable names are _NAME_ and _LABEL_.
08-14-2017 11:24 AM
I think to clarify:
proc transpose data=old_data out = new_data (rename=(_NAME_= Field) drop = _LABEL_);
label Field = 'Field';
Note: Works but does give a warning that Field is not found on the old_data set.
08-14-2017 12:05 PM
08-14-2017 12:11 PM
08-14-2017 12:18 PM
Try using the old variable name in the LABEL statement, instead of the new variable name. Order of operations issue, I think.
08-14-2017 12:19 PM
FYI - you should start your own question and not use a question that's a few months old and may not fully relate to your issue.