
Now let’s illustrate some of the SPSS string functions.īelow we create up that will be the name converted into upperĬase, lo that will be the name converted to lower case, and sub that willīe the third through eighth character in the persons name. Samuel Adams, and avg3 is also missing for Samuel Adams and ChrisĪdraktas because they both had some missing test scores. LIST name test1 test2 test3 avg avg2 avg3. COMPUTE avg2 = MEAN.2(test1, test2, test3).ĬOMPUTE avg3 = MEAN.3(test1, test2, test3). Tell SPSS that we want the mean to be missing if any of the scores were missing, by using Valid test scores using the mean.2 function. We could tell SPSS to give anyone a missing value if they have fewer than 2 Was the same as his score on test2 since that was the only non-missing For Samuel Adams, that meant that his average SPSS has the MEAN function that can do that for you,Īs shown below. For example, we might want to compute the average of the three SPSS also has statistical functions that operate on one The result hasīeen set to the system-missing value. The argument to the square root function is less than zero. Negative number and that SPSS is going to set the result to the system missing value. The one below is telling us that you cannot take the square root of a The results also included warnings like the one shownīelow.

Those values are displayed as a single decimal point. SPSS will generate missing values in such cases, as we willĮxpected SPSS to generate missing values for xsqrt, xlnĪnd xlg10 when x was negative and we see below that Log to the base 10 ( lg10) and exponential ( exp).įunctions do not work with negative numbers (for example you cannot take the square root Illustrate functions for getting the square root ( sqrt), natural log ( ln), The results below are as we would expect. LIST name test1 t1tr t1rnd test2 t2tr t2rnd. Nearest whole number using conventional rounding rules, for example 6.99 would become 7,īut 6.49 would become 6. ByĬontrast, the rnd function (short for round) rounds numbers to the The truncįunction (short for truncate) takes a number and converts it to a whole number (integer)īy removing all the decimal places, for example, 6.99 and 6.49 would become 6. We will see below, SPSS does know to treat these values as missing rather than treating Really does not look any different after we have defined the missing values. Below we tell SPSS about these missing valuesĪnd list out the data again. Missing values, and test1, test2 and test3 We will illustrate some functions using the following data file that These functionsįunction_name(argument1, argument2, etc.) Mathematical functions, string functions, and random number functions. R-bloggers - blog aggregator with statistics articles generally done with R software.SPSS has a wide variety of functions you can useįor creating and recoding variables.

Just because it has a statistic in it doesn't make it statistics. Please try to keep submissions on topic and of high quality. They will be swiftly removed, so don't waste your time! Please kindly post those over at: r/homeworkhelp. This is not a subreddit for homework questions.
#SPSS COMPUTE VARIABLE SOFTWARE#
This is a subreddit for the discussion of statistical theory, software and application.Īll Posts Require One of the Following Tags in the Post Title! If you do not flag your post, automoderator will delete it: Tag
#SPSS COMPUTE VARIABLE HOW TO#
Homework questions are for r/homeworkhelp How to ask a statistics question Modmail us if your submission doesn't appear right away, it's probably in the spam filter.
