Hello!
I'm writing because I'd like to ask for your help on a specific data transformation I want to make. At the moment I'm reading/learning about vectors. I have a couple of variables where each of them contains a single or multiple countries for a given year. What I want to do is, in that case where the observation shows multiple countries, check with the following or previous (non missing year) and keep the common country only. I'll make it more clear. Here is an example. Var20007 var2008 var2009 var 2010 var2011 Obs1 Italy, France Italy . France, Germany Germany Obs2 U.K, Belgium . . Belgium U.K What I'd like to do is: Var20007_new var2008_new var2009_new var 2010_new var2011_new Obs1 Italy Italy . Germany Germany Obs2 Belgium . . Belgium U.K Any ideas? Regards, Galatios ===================== 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
|
First things first. The way you showed the data is a bit confusing. Does
this DATA LIST command generate your sample data properly? NEW FILE. DATASET CLOSE ALL. DATA LIST LIST / v2007 to v2011 (5A20). BEGIN DATA "Italy" "France Italy" "" "France" "Germany Germany" "U.K" "Belgium" "" "" "Belgium U.K" END DATA. LIST. OUTPUT: v2007 v2008 v2009 v2010 v2011 Italy France Italy France Germany Germany U.K Belgium Belgium U.K Γαλάτιος Σιγανός wrote > Hello! > > I'm writing because I'd like to ask for your help on a specific data > transformation I want to make. > At the moment I'm reading/learning about vectors. > > I have a couple of variables where each of them contains a single or > multiple countries for a given year. > What I want to do is, in that case where the observation shows multiple > countries, check with the following or previous (non missing year) and > keep > the common country only. > I'll make it more clear. Here is an example. > > > Var20007 var2008 var2009 > var 2010 var2011 > Obs1 Italy, France Italy . > France, Germany Germany > Obs2 U.K, Belgium . . > Belgium U.K > > > What I'd like to do is: > > Var20007_new var2008_new var2009_new > var 2010_new var2011_new > Obs1 Italy Italy . > Germany Germany > Obs2 Belgium . . > Belgium U.K > > > Any ideas? > > Regards, Galatios > > ===================== > To manage your subscription to SPSSX-L, send a message to > LISTSERV@.UGA > (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 ----- -- Bruce Weaver [hidden email] http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." NOTE: My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/ ===================== 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
--
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/). |
In reply to this post by galatios
Hello,
So far I haven't received any answer on that. Just a hint would be helpful cause I don't really know how to handle it. Thank you in advance! Galatios -----Original Message----- From: Γαλάτιος Σιγανός [mailto:[hidden email]] Sent: Thursday, January 24, 2019 9:38 AM To: '[hidden email]' Subject: question on data coding Hello! I'm writing because I'd like to ask for your help on a specific data transformation I want to make. At the moment I'm reading/learning about vectors. I have a couple of variables where each of them contains a single or multiple countries for a given year. What I want to do is, in that case where the observation shows multiple countries, check with the following or previous (non missing year) and keep the common country only. I'll make it more clear. Here is an example. Var20007 var2008 var2009 var 2010 var2011 Obs1 Italy, France Italy . France, Germany Germany Obs2 U.K, Belgium . . Belgium U.K What I'd like to do is: Var20007_new var2008_new var2009_new var 2010_new var2011_new Obs1 Italy Italy . Germany Germany Obs2 Belgium . . Belgium U.K Any ideas? Regards, Galatios ===================== 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 |
Galatios,
Bruce Weaver responded on January 24 with a question about your data structure. You might want to check this thread and respond to his question so the process can go ahead.
Brian
From: SPSSX(r) Discussion <[hidden email]> on behalf of Γαλάτιος Σιγανός <[hidden email]>
Sent: Monday, January 28, 2019 3:43:25 AM To: [hidden email] Subject: FW: question on data coding Hello,
So far I haven't received any answer on that. Just a hint would be helpful cause I don't really know how to handle it. Thank you in advance! Galatios -----Original Message----- From: Γαλάτιος Σιγανός [[hidden email]] Sent: Thursday, January 24, 2019 9:38 AM To: '[hidden email]' Subject: question on data coding Hello! I'm writing because I'd like to ask for your help on a specific data transformation I want to make. At the moment I'm reading/learning about vectors. I have a couple of variables where each of them contains a single or multiple countries for a given year. What I want to do is, in that case where the observation shows multiple countries, check with the following or previous (non missing year) and keep the common country only. I'll make it more clear. Here is an example. Var20007 var2008 var2009 var 2010 var2011 Obs1 Italy, France Italy . France, Germany Germany Obs2 U.K, Belgium . . Belgium U.K What I'd like to do is: Var20007_new var2008_new var2009_new var 2010_new var2011_new Obs1 Italy Italy . Germany Germany Obs2 Belgium . . Belgium U.K Any ideas? Regards, Galatios ===================== 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
|
In reply to this post by galatios
Pretty unclear explanation. Why is France eliminated from the first case?
What is the actual goal/need/intention? Γαλάτιος Σιγανός wrote > Hello! > > I'm writing because I'd like to ask for your help on a specific data > transformation I want to make. > At the moment I'm reading/learning about vectors. > > I have a couple of variables where each of them contains a single or > multiple countries for a given year. > What I want to do is, in that case where the observation shows multiple > countries, check with the following or previous (non missing year) and > keep > the common country only. > I'll make it more clear. Here is an example. > > > Var20007 var2008 var2009 > var 2010 var2011 > Obs1 Italy, France Italy . > France, Germany Germany > Obs2 U.K, Belgium . . > Belgium U.K > > > What I'd like to do is: > > Var20007_new var2008_new var2009_new > var 2010_new var2011_new > Obs1 Italy Italy . > Germany Germany > Obs2 Belgium . . > Belgium U.K > > > Any ideas? > > Regards, Galatios > > ===================== > To manage your subscription to SPSSX-L, send a message to > LISTSERV@.UGA > (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 ----- Please reply to the list and not to my personal email. Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/ ===================== 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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
In reply to this post by bdates
Hello!
I'm sorry but I'm new to this forum. I had replied to Bruce Weaver's question but per mail. I will write down the answer here too: I think it does yes. I've attached a picture of what I get. <http://spssx-discussion.1045642.n5.nabble.com/file/t341554/printscreen.png> -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/ ===================== 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 |
This post was updated on .
In reply to this post by David Marso
I can see now that the observations/variables do not show very well here.
I hope it is going to look more consistent now. var20007 var2008 var2009 var 2010 var2011 Italy, France Italy . France, Germany Germany U.K, Belgium . . Belgium U.K When the observation consists of the name of 2 countries then I'd like to keep one of them, having taken into consideration the nearest right or left non missing observation. Let's take "Italy, France" (1st observation, variable2007) what i wanted to do is make the programme look to the nearest observation right or left and if it finds the same value (in this case "italy") then delete "France" and keep only "Italy". When It comes to "U.K, Belgium" (2nd observasion) the same rule applies. The value "Belgium" is on on var2010 so I need to keep "Belgium" and delete "U.K". So in other words the final variables should look like this: var20007_new var2008_new var2009_new var 2010_new var2011_new Italy Italy . Germany Germany Belgium . . Belgium U.K Do you think this thing is somehow possible? I hope it is more clear now and I'm really sorry I was late about finding out about this thread. Galatios -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/ ===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@LISTSERV.UGA.EDU (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 |
It was a step forward to see what the input.
Please also show what you would like. In the past I have used variable names like "Want" or "Want01 to Want05" to show what I want to see as results of transformations. ----- Art Kendall Social Research Consultants -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/ ===================== 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
Art Kendall
Social Research Consultants |
Hello,
I added a few lines in my post. Let me know if you need further clarification. Galatios -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/ ===================== 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
|
List members who do not use Nabble will need to look at your post in that
archive to see your edits. Here is the link to the post I think you mean: http://spssx-discussion.1045642.n5.nabble.com/question-on-data-coding-tp5737315p5737332.html galatios wrote > Hello, > > I added a few lines in my post. > Let me know if you need further clarification. > > Galatios > > > > -- > Sent from: http://spssx-discussion.1045642.n5.nabble.com/ > > ===================== > To manage your subscription to SPSSX-L, send a message to > LISTSERV@.UGA > (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 ----- -- Bruce Weaver [hidden email] http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." NOTE: My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/ ===================== 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
--
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 |