Hi all,
the MEAN.1 function allows to compute an average value of several values even if only one variable is available. Is there any way to realize the reverse -- computing the arithmetical mean if only one variable is missing, else not? I think such a function would make more sense. A brief "yes, there is" (preferably with a short mention of the command) or "no, there isn't" would be perfectly sufficient as an answer :) Thanks to you all Tanja -- Tanja Gabriele Baudson Universität Trier FB I Psychologie Hochbegabtenforschung und -förderung 54286 Trier Fon 0651/201-4558 Fax 0651/201-4578 Email [hidden email] Web http://www.uni-trier.de/index.php?id=9492 ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Tanja
The number follwowing the dot represents the minimum number of variables that must be present for the mean to be calculated. So if you are averaging four variables, MEAN.3(var1, var2, var3, var4) will compute the case mean if any three (or all four) of the variables are non-missing. If two or more variables are missing for a case, the result will be missing. Garry Gelade -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Tanja Gabriele Baudson Sent: 07 May 2011 10:15 To: [hidden email] Subject: Averaging values/MEAN function Hi all, the MEAN.1 function allows to compute an average value of several values even if only one variable is available. Is there any way to realize the reverse -- computing the arithmetical mean if only one variable is missing, else not? I think such a function would make more sense. A brief "yes, there is" (preferably with a short mention of the command) or "no, there isn't" would be perfectly sufficient as an answer :) Thanks to you all Tanja -- Tanja Gabriele Baudson Universität Trier FB I Psychologie Hochbegabtenforschung und -förderung 54286 Trier Fon 0651/201-4558 Fax 0651/201-4578 Email [hidden email] Web http://www.uni-trier.de/index.php?id=9492 ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
I think the following accomplishes what the OP wanted:
* Calculate the Number of missing values for N variables. * V5 is used as the last variable but it should be set to * whatever the relevant variable is. count Nmissing= V1 to V5 (missing). Do if (Nmissing eq 1). compute mean.minus.one=mean(V1 to V5). end if. The above should allow one to calculate a mean for any fixed number of missing values (though one should have good reasons for why they are doing so). -Mike Palij New York University [hidden email] ----- Original Message ----- From: "Garry Gelade" <[hidden email]> To: <[hidden email]> Sent: Saturday, May 07, 2011 5:53 AM Subject: Re: Averaging values/MEAN function > Tanja > > The number follwowing the dot represents the minimum number of variables > that must be present for the mean to be calculated. > So if you are averaging four variables, MEAN.3(var1, var2, var3, var4) will > compute the case mean if any three (or all four) of the variables are > non-missing. If two or more variables are missing for a case, the result > will be missing. > > Garry Gelade > > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of > Tanja Gabriele Baudson > Sent: 07 May 2011 10:15 > To: [hidden email] > Subject: Averaging values/MEAN function > > Hi all, > > the MEAN.1 function allows to compute an average value of several > values even if only one variable is available. Is there any way to > realize the reverse -- computing the arithmetical mean if only one > variable is missing, else not? I think such a function would make more > sense. A brief "yes, there is" (preferably with a short mention of the > command) or "no, there isn't" would be perfectly sufficient as an > answer :) > > Thanks to you all > Tanja > -- > Tanja Gabriele Baudson > Universität Trier > FB I Psychologie > Hochbegabtenforschung und -förderung > 54286 Trier > Fon 0651/201-4558 > Fax 0651/201-4578 > Email [hidden email] > Web http://www.uni-trier.de/index.php?id=9492 ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Administrator
|
Alternatively, one could use the NMISS function.
if (NMISS(v1 to v5) EQ 1) mean.minus.one=mean(V1 to V5).
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
Free forum by Nabble | Edit this page |