Computing Means in SPSS - Quick Tutorial & Examples

Поделиться
HTML-код
  • Опубликовано: 22 окт 2023
  • DESCRIPTION:
    Computing means in SPSS is pretty straightforward but there's a couple of things you should know such as
    -how do different functions handle missing values?
    -how to exclude cases that have too many missing values?
    -why should I use commas instead of spaces between variable names?
    In this video, I'll slowly walk you the basics, tricks and pitfalls regarding means in SPSS. Since we'll use a very tiny data file, we'll easily see how things work.
    TIMESTAMPS:
    01:25 example 1 - means over adjacent variables
    05:16 example 2 - means over non adjacent variables
    07:32 example 3 - exclude cases with many missing values
    09:41 do's for computing means
    14:37 dont's for computing means
    19:44 wrong results from SUM function
    21:40 wrong results from + operator
    RESOURCES:
    Download data file: www.spss-tutorials.com/downlo...
    Download final syntax: www.spss-tutorials.com/downlo...
    SPSS syntax intro: www.spss-tutorials.com/spss-s...
    FOLLOW US:
    Official website: www.spss-tutorials.com/
    LinkedIn: / spss-tutorials
    Facebook: / spss.tutorials.website
    #SPSS #Dataanalysis

Комментарии • 6

  • @JonPeck100
    @JonPeck100 8 месяцев назад +1

    I notice you have the toolbar turned off in the syntax window, but if you need to insert a list of variable names into the syntax, the Variables toolbar button is very useful. Of course, TO is fine for contiguous variables, but pasting from the toolbar is pretty convenient, especially if variable names are long. And it shows you the variable metadata, too. Paste from that window leaves it open so you can easily reference it in multiple places. Easier than copying from Variable View.
    And, BTW mean, sum, etc are functions, so comma separators are necessary in order for the expression to be unambiguous. It would be nice if there were a control on the Variables dialog for what to paste as the separator, but, there is a way to define macros and control the separator for advanced users.

    • @SPSS-tutorials
      @SPSS-tutorials  8 месяцев назад

      Hi Jon!
      I tried the variables toolbar tool but it inserted the variable names separated by spaces.
      Also, why is something like
      COMPUTE M01 = MEAN(V01 V03).
      ambiguous and
      DESCRIPTIVES V01 V03.
      not? Am I overlooking something here?

    • @JonPeck100
      @JonPeck100 8 месяцев назад

      Yes, it only does spaces, as I said, but it is still easier than copying variable names out of Variable View.
      As for the functions, ALL functions use comma-separated arguments. It would be inconsistent and confusing to have some allowing blanks and some requiring commas. And, remember, the function arguments could themselves be complex expressions.

    • @SPSS-tutorials
      @SPSS-tutorials  8 месяцев назад

      @@JonPeck100 I find it inconsistent that SPSS procedures allow spaces between variable names but functions don't.
      Why can't I ALWAYS separate variable names by spaces, both for functions and procedures?
      Could you give an example of an expression that would be rendered ambiguous by allowing spaces rather than commas? I think the rules for variable names always preclude this -but please show me wrong on this one.
      Also, I think long variable names are better avoided at all times. Since we've variable labels that accurately describe the exact meaning, long names only render syntax unnecessarily long and unreadable.
      I oftentimes use something like
      RENAME VARIABLES (ALL = V000 TO V113).
      and I never regretted it ;-)

    • @JonPeck100
      @JonPeck100 8 месяцев назад

      Of the programming languages I am familiar with, they all require some sort of separator for function arguments: Fortran, C, C++, Java, Python, R, Basic, SAS, and others. That is good for readability and makes more accurate error messages possible. If blanks were legal as a separator, argument expressions would not be able to contain spaces.
      As for variable names, the world rejoiced when SPSS went from 8 bytes to 63 length, but I agree that really long names are clumsy. Name should be long enough to be descriptive for readability, and with the current limit, the user can just forget about a length constraint.

    • @SPSS-tutorials
      @SPSS-tutorials  8 месяцев назад

      @@JonPeck100 "If blanks were legal as a separator, argument expressions would not be able to contain spaces."
      Why not? Variable naming conventions always distinguish variable names from numbers, operators and functions, right? So even something like
      COMPUTE M01 = MEAN(2 * V10 TRUNC ( V20 ) ).
      is unambiguous insofar as I can see. And I can't think of any example where this would cause any problem...
      But I agree that this particular example doesn't look nice...