Is there a way or mechanism with SPSS to create "data" based on
existing variables and givin plausible ranges of their values. I don't mean random numbers. I want to simulate my analyse with some data. For example two variables. v1 is numeric with a range from 0 to 15 and a missing value of '-9'. v2 is string with a max length of 64 and min length of 4 and missing value ''. Now I just need 100 observations (is it the correct SPSS word for that?) with this givin parameters. But the important point to know is that the variables itself (with all its specifications, labes, etc) are still existing. I just want to fill them. I don't want to create new variables while simulating data. I created the variables while a GET DATA from a cvs-file and some modifications (VALUE LABEL, etc) after that. Is this possible? ===================== 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 |
On 2014-03-26 21:23 Moon Kid <[hidden email]> wrote:
> Is this possible? btw: Of course I found SIMPLAN but didn't unterstand it. I think simulating data is quite simple task. variable, min, max, thats all. SIMPLAN looks quite to complex for that. ===================== 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 Moon Kid
See LOOP and XSAVE commands!
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 Moon Kid
Well, if all you need to define is min
and max:
input program. loop #i=1 to 100. compute var1=rv.uniform(min, max). compute var2=rv.uniform(min, max). etc. end case. end loop. end file. end input program. If you want integer ranges: trunc(rv.uniform(min, max+1)). Then use APPLY DICTIONARY to apply the variable definitions you indicated you already saved in another SAV file. The variable names you specify in the input program should correspond to the variable names in the previously saved file. I think you indicated previously that you did not want random values, but if the only parameters you are providing are min and max, then what else could the values between those parameters be? Rick Oliver Senior Information Developer IBM Business Analytics (SPSS) E-mail: [hidden email] From: Moon Kid <[hidden email]> To: [hidden email], Date: 03/26/2014 03:48 PM Subject: Re: simulate data Sent by: "SPSSX(r) Discussion" <[hidden email]> On 2014-03-26 21:23 Moon Kid <[hidden email]> wrote: > Is this possible? btw: Of course I found SIMPLAN but didn't unterstand it. I think simulating data is quite simple task. variable, min, max, thats all. SIMPLAN looks quite to complex for that. ===================== 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 |
In reply to this post by Moon Kid
In order to create new rows in an existing
dataset, you need to start with at least one case (observation, row). Then
transformation commands can generate a file with as many as needed.
For example (just one variable). Typically you would fill these with, yes, random data. data list list/x(f8.2). begin data 1 end data. loop #i = 1 to 10. compute x = rv.uniform(0,15). xsave outfile="c:\temp\tencases.sav". end loop. exec. INPUT PROGRAMs can create entire new datasets with case values, but they can't do that into an existing dataset. However, you could use APPLY DICTIONARY to copy over the metadata from your empty one. There is a custom dialog called SimulateActiveDataset available from the SPSS Community website that can simulate a new dataset that is like an existing one, including the metadata, but it needs cases as input in order to determine the distributions to match up with. Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] phone: 720-342-5621 From: Moon Kid <[hidden email]> To: [hidden email], Date: 03/26/2014 02:24 PM Subject: [SPSSX-L] simulate data Sent by: "SPSSX(r) Discussion" <[hidden email]> Is there a way or mechanism with SPSS to create "data" based on existing variables and givin plausible ranges of their values. I don't mean random numbers. I want to simulate my analyse with some data. For example two variables. v1 is numeric with a range from 0 to 15 and a missing value of '-9'. v2 is string with a max length of 64 and min length of 4 and missing value ''. Now I just need 100 observations (is it the correct SPSS word for that?) with this givin parameters. But the important point to know is that the variables itself (with all its specifications, labes, etc) are still existing. I just want to fill them. I don't want to create new variables while simulating data. I created the variables while a GET DATA from a cvs-file and some modifications (VALUE LABEL, etc) after that. Is this possible? ===================== 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 |
In reply to this post by Moon Kid
Simulating data may take more than a minimum and maximum. There are specifications for various distributions in the Transform Variable area. Each requires different parameters. You'll need to identify the distribution you want your data to follow. In the last three months, there was a thread regarding generating datasets. You can check it out in the archives.
-----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Moon Kid Sent: Wednesday, March 26, 2014 4:44 PM To: [hidden email] Subject: Re: simulate data On 2014-03-26 21:23 Moon Kid <[hidden email]> wrote: > Is this possible? btw: Of course I found SIMPLAN but didn't unterstand it. I think simulating data is quite simple task. variable, min, max, thats all. SIMPLAN looks quite to complex for that. ===================== 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 |
Free forum by Nabble | Edit this page |