when writing an expression in the compute variables dialog window: spss is not case sensitive with respect to variable names. this expression must include one or more variables from your dataset, and can use arithmetic or functions.
#Spss compute variable how to
C numeric expression: specify how to compute the new variable by writing a numeric expression. In this tutorial, i will demonstrate how to compute a mean (average) variable from a set of variables in spss.spss version used: 25the online guide to. a good example is to add the suffix ‘ avg ‘ to the variable name to signify that it is a mean. remember, spss does not like spaces in the variable names. in the new compute variable window, first enter the name of the new variable to be created in the ‘ target variable ‘ box. in spss, go to ‘ transform > compute variable ‘. You can also browse for pages similar to this one at Category: Data management or Category: SPSS software.1. Information? I have a page with general help Although I do not hold the copyright for this material, I am reproducing it here as a service, as it is no longer available on the Children's Mercy Hospital website. Steve Simon while working at Children's Mercy Hospital. There were otherĮnhancements, but to me this is the only important one. This is a very pleasant surprise, since dates are a source of constantĬonfusion for me and for the people I work with. Select TRANSFORM | DATE/TIME from the menu. Page showing some of the issues involved with computing The most notable change is in date calculations.ĭate and time variables in SPSS have always been difficult. I attended a web seminar on the new enhancements in version 13.0 of SPSS Raynald Levesque has a nice web tutorial about Divide this difference by 86,400 (=24 hours * 60 minutes * 60 So when you calculate theĭifference between two date values, you see the number of seconds between the Number of seconds since October 14, 1582. Professor Mean explains that SPSS stores data values as the Stumped Sharon is having problems with some calculations using dates in Length of stay as the difference between two date values. This figure shown above indicates that you have successfully computed Which you should type into the NUMERIC EXPRESSION field. The formula for computing length of stay is The figure shown above is the dialog box that you get. Stay, you need to select TRANSFORM | COMPUTE from the SPSS menu. Newobrn babies admitted with a diagnosis of dehydration. The hospital (dateadm), and date of discharge from the hospital (datedsc) for The data shown above represents the birthdate (dob), date of admission to Dividing by 86400 changes the units fromĪ common example using dates is computing length of stay in the hospital. Then place a slash at theĮnd, followed by 86400. Place parentheses around the entire expression. If you are using dates, then this time interval is expressed in seconds. Finally, select the second variableĪnd add it to the NUMERIC EXPRESSION field after the minus sign. The minus button in the mini calculator). Then select the first variableĪnd add it to the NUMERIC EXPRESSION field. This difference in the TARGET VARIABLE field. To subtract one column of numbers from another in SPSS, you select Little more than 13 billion seconds to SPSS.
#Spss compute variable software
The date of, for example, theĭate when all the antiquated software in the world will crash, is just a To see what SPSS is doing, reformat the date as a number. DivideĪgain by 7, 30, or 365.25 to get duration in weeks, months, or years. Subtract two dates, you get the duration of injury in seconds.ĭivide by 86,400 (=24*60*60) to get the duration of injury in days. If you specify onlyĪ date and not a time, then SPSS sets the time to midnight. SPSS stores date/time values as the number of seconds since Octoberġ4, 1582 (the start of the Gregorian calendar). Maybe your patients were waiting for their HMO to approve a visit to a The date of injury from the date of interview. For example, I want to use a compute statement in SPSS to createĪ new variable called duration of injury (durinj). Stats: Date calculations in SPSS (August 18, 1999) StATS: Date calculations in SPSS (created )ĭear Professor Mean, I am trying to use dates in SPSS for certainĬalculations.