Questions in topic: "compute"
https://developer.ibm.com/answers/questions/topics/single/350780.html
The latest questions for the topic "compute"SPSS population census and fertility ratio
https://developer.ibm.com/answers/questions/519234/spss-population-census-and-fertility-ratio.html
Hi guys,
I am trying to calculate a fertility ratio out of a census by group of age. The two main variables I need that are actually found in the census are women from 15 to 49 yrs old and children from 0 to 5 yrs old.
If I take the Child-Women Ratio (CWR) of the population, I just divide the number of children from 0 to 5 yrs old / women from 15 to 49 yrs old = CWR.
But the problem comes when I want to calculate that ratio by group of age (15-19 ; 20-24 ; 25-34; 35-44 ; 45 +). So I need to 'link' children to their mother. I just don't know how to manipulate the data.
There are not actual calculus here, but only data manipulation so I can after it, select the Frequency function and show the occurence.
Another variable I have in the dataset is also the 'relation to the head', which tells me the relation of the individual to the father (so I look for son, daughter and spouse of the same family) and I also have a variable called 'family unit' which indicate thanks to a family number to which family the mother and the children belong.
I cannot just filter the women by group age and then divided by the number of children from 0 to 5. I need to get the children which are associated to the women of the group age. Well, this is how I understand it.
Here is an example I made up on Excel to help visualize what I mean.
![alt text][1]
Is anyone has any idea how to make that work ?
Your help would be a lifesaver !
Cheers
[1]: /answers/storage/temp/29562-capture-decran-le-2019-10-04-a-192721.pngsyntaxvariablescomputeSat, 05 Oct 2019 01:31:53 GMTGuidurHow do I compute a sum of continuous variables while excluding the string variables using syntax?
https://developer.ibm.com/answers/questions/518366/how-do-i-compute-a-sum-of-continuous-variables-whi.html
I'm trying to use SPSS syntax to compute minall = min(V1, V2 etc.) for a dataset with a LOT of variables. I was hoping to be able to use something like: min(v1 TO v102). However, some of my variables are string and I want to exclude only those. Is there a way I can exclude the string variables but still run this without entering every variable into the code? I don't want to have to manually enter every single variable into the code because that will take a very long time. Any help would be greatly appreciated!syntaxstringcomputeThu, 26 Sep 2019 00:42:19 GMTAnnettaCombining date/time variables, in new variable.
https://developer.ibm.com/answers/questions/514055/combining-datetime-variables-in-new-variable.html
Need help, nothings working... Using syntax.
I have 3 date/time variables (Date1, date2, date3), that I would like to combine i a fourth (Start_date), so that if date1 is missing, spss will use date2, and if that is also missing, spss will use date3.
This is my syntax code.
DO IF Date1 ne 0.
COMPUTE Start_date=Date1.
ELSE IF sysmis(Date1).
COMPUTE Start_date=Date2.
ELSE IF sysmis(Date2).
COMPUTE Start_date=Date3.
END IF.
SPSS doesn't present me with any error codes, in the output window, it looks like all is well, but when I use the "Frequencies" og "Descriptive statistics" command, only the first line has bebn run, so all sysmis(Date1) are still blank, and havent' been replaced by anything.
Been stuck here for a while, and tried 100 different things... Help!spssstudenthelpdatetimecomputesysmisTue, 06 Aug 2019 11:58:31 GMTAnne MBHow to enter the value of a statistic in a computational expression?
https://developer.ibm.com/answers/questions/499061/how-to-enter-the-value-of-a-statistic-in-a-computa.html
For example, if I want to normalize Var1,
Compute Var1n = (Var1 - Min (Var1)?) / (Max (Var1)? - Min (Var1)?)computeThu, 28 Mar 2019 09:41:39 GMTGildo54Create a new variable based on date
https://developer.ibm.com/answers/questions/492730/create-a-new-variable-based-on-date.html
Hello All,
I need to compute a variable based on two variables (one variable which is a date and the other nominal). The nominal variable ('Treatment') has 2 labels of treatment conditions ('individual' coded as 1 and 'group' coded as 2) but need to further separate the group into 2 additional separate labels (labelled 'Group1' and 'Group2') based on the date they were conducted in a new computed variable - 'Assessment.Date' (dd.mm.yyyy).
So, if the group commenced before 01.05.2017 then it was group1 condition. If the group commenced after 01.05.2017 then it is group2 condition.
Can anyone help me with this? Ideally finding out if there is a way to do this on Syntax, but if not any way! I have been attempting to figure this out for hours and no-one that I have asked seems to know!
Thank you.spssspssstudentspss24variablescreatedatestransformcomputeTue, 12 Feb 2019 18:16:52 GMTAmy AshbyHow to compute a variable with an "all" sub variable included?
https://developer.ibm.com/answers/questions/482329/how-to-compute-a-variable-with-an-all-sub-variable.html
Hello everyone,
I am doing marketing research for a university project and in order to analyse the data properly we need to merge some variables into 1.
The old variables look as follows
SPEED_8yrold 1(if they checked the box)
SPEED_12yrold 1(if they checked the box)
SPEED_all 1(if they checked the box)
This is a small example of the data exported from qualtrics.
I would like to make it so that all SPEED_all data just adds to the other 2 variables and add it into a new one like so:
NEWVAR: 1=(8yrolds) 2=(12yrolds)
I know how to do this with just the first 2 variables, but I dont know how to merge the all variable as explained.
I hope it is explained in a clear and proper way.
Kind regards and thanks in advance!spssvariablesmergecomputeTue, 27 Nov 2018 14:30:25 GMTRevontuliCompute one variable that represents 2 variables. (UMBRELLA VARIABLE)
https://developer.ibm.com/answers/questions/481470/compute-one-variable-that-represents-2-variables-u.html
I have a question regarding ' compute variable' .
I have two variables (scale variables) named Seeding & Viral.
I want to create one variable that represents both Seeding & Viral, while keeping the data in the variables intact.
So i want te create a variable that for example is called: SEEDINGVIRAL, and when you run a frequencies/descriptives test for SEEDINGVIRAL, you see the data of Seeding and Viral separate from each other, in their intact form.
so the variable that i'm trying to create will act as a 'umbrella' variable. it holds the data from Seeding & Viral.
I am wondering if there is a ' compute variable' 'function group' key for this.
i am already familiar with for example the compute variable function group keys like 'means' but i do not want to use this one because this will alter the data when i would use it to the mean of the variables Seeding & Viral.
I want to keep the data of Seeding & Viral Intact (not multiply or adding up or mean) and have them in one umbrella variable.
can anybody help me with this?
if you require more information, feel free to ask, i would be glad to elaborate!
regards,
PimvariablesmergecomputeWed, 21 Nov 2018 11:35:39 GMTPimZwinkelsSPSS Syntax - DO IF Else logic: Computing variable "if any three variables equal...."
https://developer.ibm.com/answers/questions/472264/spss-syntax-do-if-else-logic-computing-variable-if.html
Hello! I have a question regarding syntax for recoding multiple variables into a new variable in SPSS.
The set-up: I have 7 dichotomized variables (VAR1X, VAR2, VAR3, VAR4, VAR5, VAR6, VAR7) and want to recode them into new variable "VALID." Assume for all variables 0=invalid, and 1=valid. VAR1X is special. If VAR1X = 0, then the case can be recoded as 0, without examining the other variables. However, if VAR1X=1, the other variables must be evaluated. If VAR1X=1 and any 3 or more of variables VAR2 through VAR7 = 0, then those cases should be coded 0.
So far I have:
DO IF (VAR1x=0).
COMPUTE Valid=0.
ELSE IF (VAR1X=1 AND
**How do I add something after the AND that basically says "If three or more variables VAR2 through VAR 7 = 0" COMPUTE Valid=0 ?
If you can provide guidance on that, I can probably figure out the final line, which will account for the final condition (e.g., VAR1X = 1 and two or less of the other variables = 0, COMPUTE Valid=1).
Thanks!spsssyntaxvariablesconditioncomputeWed, 26 Sep 2018 23:17:32 GMTAVSteeleApplying compute function to new data
https://developer.ibm.com/answers/questions/468491/applying-compute-function-to-new-data.html
Hi!
I used the Transform> Compute function to create new variables as an average of existing other variables. I entered data and ran the function. Now that I have just received a new dataset and plugged them into the sheet, I need to apply the average function to them. Is there a way to do that? ![alt text][1]
You can see the dots in the picture below, which represent the cells that need to have the average function applied on.
[1]: /answers/storage/temp/23990-screen-shot-2018-09-04-at-125040-pm.pngcomputeTue, 04 Sep 2018 09:54:09 GMTDragging functionsSplitting a string variable divided by comma's into new single variables
https://developer.ibm.com/answers/questions/442099/splitting-a-string-variable-divided-by-commas-into.html
Hello,
In my dataset there is a single variable called inventorauthor (we are researching patents) that has several names in it and is divided with comma's.
I would like to split this variable, that sometimes consists out of only one name and for another patent has up to 10 inventorauthors into new variables. For instance, when there is only one name, i want to make a new variable that names it author_1, when there are two names, two variables (author_1 and author_2) and so forth.
I recently saw that there is a similar command posted on this fora that splits variables the same way but since my initial variable is comprised out of a different number of responses (authors) it did not work properly.
Thanks!spssvariablesstringdatasetssplitcomputesplit-conditionsThu, 12 Apr 2018 10:14:54 GMTvanderZwanCompute new variable based on variable labels
https://developer.ibm.com/answers/questions/425470/compute-new-variable-based-on-variable-labels.html
Hi there,
I do have a lot of variables with different names (e.g. "ID001", "ID001A", "ID001B", "ID002", "ID002A" etc.) and I want to create the mean of each IDs (e.g. a variable with the mean of all ID001-variables, another variable with the mean of all ID002-variables etc.). I though I'd somehow need to tell the program that
*IF the first 5 characters of a variable lable are the same, compute a new variable with their mean* Is that somehow possible?
Thanks for any help, I appreciate it!
RubenstatisticscomputeThu, 18 Jan 2018 19:53:23 GMTruboin