@MadQuidd wrote:
in the code I have to create the variable 'Improvement' it does not exsist in the data set. I do not understand how to create such a variable
What you did in your code is that you created new variable
Increase = (Posttest - Pretest);
and this variable is not exist in the dataset _most probably_.
What happen here is that the new variable "Increase" is created by "Using an Assignment Statement" which is (=). And you did not specify the length or the type of this variable, but what happened is you assigned to it a value. So SAS determines the length of this variable from its first occurrence. And this new variable gets the same type and length as the expression on the right side of the assignment statement.
Comming to the other variable "improvement" that you wanted to create
improvement =
if increase >= 16 then improvemnt = 1
else if 10 <increase <16 then improvement =2
else if increase > 10 then improvement = 3
In your code you have done several sytanx errors as @Reeza mentioned. Building on what we said before and based on that you will create the new variable by the same method. There was no need for your first statment. As the Assignment Statement in each one of your if condition statment would be enough fot creating the new variable you wanted.
@MadQuidd wrote:
in the code I have to create the variable 'Improvement' it does not exsist in the data set. I do not understand how to create such a variable and make it fall into certain catagories.
I assume that what you mean is how to assign value to a variable based on specific conditions. And i think you know enough about that based on your code. But be carefull when you translate your requirements to code. As you also have logic mistakes in writing your if statments.
read more in
IF-THEN/ELSE Statement
Ways to Create Variables
... View more