how do I create an additional group from 4 existing groups?

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

pregnancyhtn
Posts: 12
Joined: Wed Apr 09, 2014 6:28 am

how do I create an additional group from 4 existing groups?

Postby pregnancyhtn » Wed Apr 09, 2014 6:39 am

Hello

My dataset is currently set on giving output into 4 groups using the split file option.

I now need to extract subjects from those 4 groups to form a 5th group based on a different outcome from the ones used to divide the groups in the first instance
ive tried adding this outcome as an extra one in the split file model but ended up with 4 extra groups when I only want the one

any ideas on how to do this?

Thanks
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: how do I create an additional group from 4 existing grou

Postby GerineL » Wed Apr 09, 2014 7:43 am

it is still a bit vague to me what you want to do exactly, but it sounds to me like you might need an if-function in your syntax to create that fifth variable...
if not, please give more info (i.e., what kindo f values do your other vars hold, what do you want the fifth var to look like etc)
pregnancyhtn
Posts: 12
Joined: Wed Apr 09, 2014 6:28 am

Re: how do I create an additional group from 4 existing grou

Postby pregnancyhtn » Wed Apr 09, 2014 8:11 am

Thanks for your reply Gutnre

let me describe the scenario to you
First the population was divided into two groups using a variable of whether or not the hypertension was developed during pregnancy (PIH) or before pregnancy (PEH)
Then the second variable put into the split file was whether these were prescribed a medication or not .
this resulted in 4 groups:
PIH prescribed medication
PIH NOT prescribed medication
PEH prescribed medication
PEH NOT prescribed medication

Now I need to take the subjects that have another outcome (lets call it PET) to take them out of these groups and make group number 5 out of them

Does that make it any clearer?

Thanks
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: how do I create an additional group from 4 existing grou

Postby GerineL » Wed Apr 09, 2014 8:37 am

Thanks for explaining, basically it doesn't realy matter what the content is (in terms of: variable 1 is pregnancy), but more what kind of values they have (e.g.: var 1 is either 1 or 0).

But anyway, I think you can indeed use if-functions, look at some case studies for examples.

it would become something like:

if (pregnant = 1 & medication = 1) combined = 1.
if (pregnant = 0 & medication = 1) combined = 2.
if (pregnant = 1 & medication = 0) combined = 3.
if (pregnant = 0 & medication = 0) combined = 4.
if (pet = 1) combined = 5.
execute.
pregnancyhtn
Posts: 12
Joined: Wed Apr 09, 2014 6:28 am

Re: how do I create an additional group from 4 existing grou

Postby pregnancyhtn » Wed Apr 09, 2014 9:25 am

ok thanks for that

I tried that syntax command and got an error # 4381 and the expression ends unexpectedly
what does that mean??
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: how do I create an additional group from 4 existing grou

Postby GerineL » Wed Apr 09, 2014 11:48 am

please note that you should replace the variable names here with your variable names.

please post the entire output here (I don't know all error messages by heart).
pregnancyhtn
Posts: 12
Joined: Wed Apr 09, 2014 6:28 am

Re: how do I create an additional group from 4 existing grou

Postby pregnancyhtn » Thu Apr 10, 2014 1:09 am

yes, I have done that with the variables

this is the error message:


>Error # 4381 in column 1. Text: IF
>The expression ends unexpectedly.
>Execution of this command stops.
IF (pregnancyinducedhtnyorno = 1 & medicationyesorno = 1) combined = 1.
IF (pregnancyinducedhtnyorno = 1 & medicationyesorno = 0) combined = 2.
IF (pregnancyinducedhtnyorno = 0 & medicationyesorno = 1) combined = 3.
IF (pregnancyinducedhtnyorno = 0 & medicationyesorno = 0) combined = 4.
IF (anyformPETyesorno = 1) combined = 5.
execute.




thanks
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: how do I create an additional group from 4 existing grou

Postby GerineL » Fri Apr 11, 2014 10:10 am

it looks like this may refer to something in your syntax before this command...
pregnancyhtn
Posts: 12
Joined: Wed Apr 09, 2014 6:28 am

Re: how do I create an additional group from 4 existing grou

Postby pregnancyhtn » Sat Apr 12, 2014 9:04 am

ok, but if that's the case, why wasn't anything changed in the ordering of the groups in the dataset?
there wasn't anything else in the syntax before (nothing that I was aware of)
pregnancyhtn
Posts: 12
Joined: Wed Apr 09, 2014 6:28 am

Re: how do I create an additional group from 4 existing grou

Postby pregnancyhtn » Tue Apr 15, 2014 6:49 am

Ok, so any other advice on where to go from here in terms of proceeding with this grouping?

Thanks
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: how do I create an additional group from 4 existing grou

Postby GerineL » Tue Apr 15, 2014 8:19 am

yes, please provide the entire syntax (so including the part above this error message), so we can figure out what is going wrong.

Also, please check whether you made any spelling errors in the variable names.
pregnancyhtn
Posts: 12
Joined: Wed Apr 09, 2014 6:28 am

Re: how do I create an additional group from 4 existing grou

Postby pregnancyhtn » Tue Apr 15, 2014 2:00 pm

IF (pregnancyinducedhtnyorno = 1 & medicationyesorno = 1) combined = 1.
IF (pregnancyinducedhtnyorno = 1 & medicationyesorno = 0) combined = 2.
IF (pregnancyinducedhtnyorno = 0 & medicationyesorno = 1) combined = 3.
IF (pregnancyinducedhtnyorno = 0 & medicationyesorno = 0) combined = 4.
IF (anyformPETyesorno = 1) combined = 5.
execute.

that's the whole syntax

ive checked for spelling mistakes and there aren't any
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: how do I create an additional group from 4 existing grou

Postby GerineL » Tue Apr 15, 2014 2:09 pm

and is the whole output empty before this occurs?
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: how do I create an additional group from 4 existing grou

Postby GerineL » Tue Apr 15, 2014 2:11 pm

Because it is most likely you forgot a point or something in the last part of the syntax (so the part before this).
pregnancyhtn
Posts: 12
Joined: Wed Apr 09, 2014 6:28 am

Re: how do I create an additional group from 4 existing grou

Postby pregnancyhtn » Thu Apr 17, 2014 4:57 am

This is all the output, there was no empty space:



if (pregnancyinducedhtnyorno = 1 & medicationyesorno = 1) combined = 1
if (pregnancyinducedhtnyorno = 1 & medicationyesorno = 0) combined = 2
if (pregnancyinducedhtnyorno = 0 & medicationyesorno = 1) combined = 3
if (pregnancyinducedhtnyorno = 0 & medicationyesorno = 0) combined = 4
if (anyformPETyesorno = 1) combined = 5
execute.

>Error # 4381 in column 1. Text: if
>The expression ends unexpectedly.
>Execution of this command stops.
if (pregnancyinducedhtnyorno = 1 & medicationyesorno = 1) combined = 1
if (pregnancyinducedhtnyorno = 1 & medicationyesorno = 0) combined = 2
if (pregnancyinducedhtnyorno = 0 & medicationyesorno = 1) combined = 3
if (pregnancyinducedhtnyorno = 0 & medicationyesorno = 0) combined = 4
if (anyformPETyesorno = 1) combined = 5
execute.

>Error # 4381 in column 1. Text: if
>The expression ends unexpectedly.
>Execution of this command stops.
IF (pregnancyinducedhtnyorno = 1 & medicationyesorno = 1) combined = 1
IF (pregnancyinducedhtnyorno = 1 & medicationyesorno = 0) combined = 2
IF (pregnancyinducedhtnyorno = 0 & medicationyesorno = 1) combined = 3
IF (pregnancyinducedhtnyorno = 0 & medicationyesorno = 0) combined = 4
IF (anyformPETyesorno = 1) combined = 5
execute.

>Error # 4381 in column 1. Text: IF
>The expression ends unexpectedly.
>Execution of this command stops.
IF (pregnancyinducedhtnyorno = 1 & medicationyesorno = 1) combined = 1.
IF (pregnancyinducedhtnyorno = 1 & medicationyesorno = 0) combined = 2.
IF (pregnancyinducedhtnyorno = 0 & medicationyesorno = 1) combined = 3.
IF (pregnancyinducedhtnyorno = 0 & medicationyesorno = 0) combined = 4.
IF (anyformPETyesorno = 1) combined = 5.
execute.
DATASET ACTIVATE DataSet1.
SAVE OUTFILE='\\vcp.local\UserFolders\B\amyna\Desktop\thedatabasetobeusedforthemothers.sav'
/COMPRESSED.

Who is online

Users browsing this forum: No registered users and 6 guests

cron