[EpiData-list] Command Select

EpiData development and support epidata-list at lists.umanitoba.ca
Mon Feb 8 07:08:40 CST 2021


Try this:

freq castem;
select castem<>3 do freq castem;

The selection is only used for the statement following ‘do’. If you want to keep it for a few statements, use ‘do begin;’ with ‘end;’

count; // all records
select castem <> 3 do count; // subset of records
count; // all records again

select castem <> 3 do drop data;
count; // all statements from here on will use only the subset of records
save “subset.epx”; new dataset with subset of records

The change in operation of the select command promotes clearer programming. With the persistent select command in EpiData classic, it was easy to forget to do

select; 

to clear the selection.

Jamie

> On Feb 8, 2021, at 6:05 AM, EpiData development and support <epidata-list at lists.umanitoba.ca> wrote:
> 
> Thank you for your response.
> 
> Example with my own file.
> 
> 
> 
> .freq castem;
> 
>  castem  
> 
> -----------
> 
>         N
> 
> -----------
> 
>     1 153
> 
>     2 150
> 
>     3 632
> 
> -----------
> 
> Total 935
> 
> -----------
> 
> 
> 
> .select castem<>3 do;
> 
> Selecting, please wait...
> 
> (303 of 935 selected)
> 
> 
> 
> .begin;                               ==> No operative (idem begin without <
> ; >)
> 
> ERROR: Line 1: Syntax error at pos 7: 
> 
> ERROR: Unexpected end of line!
> 
> Perhaps a ";" is missing?
> 
> 
> 
> 
> 
> .freq castem;  ==> no selection...
> 
>  castem  
> 
> -----------
> 
>         N
> 
> -----------
> 
>     1 153
> 
>     2 150
> 
>     3 632
> 
> -----------
> 
> Total 935
> 
> -----------
> 
> 
> 
> .select castem=1 do drop data; ==> objective : keep codage 1
> 
> 
> 
> Selecting, please wait...
> 
> (153 of 935 selected)
> 
> 
> 
> (153 observations dropped)
> 
> 
> 
> .freq castem; ==> Selection code<> 1 (link avec drop data ?)
> 
>  castem  
> 
> -----------
> 
>         N
> 
> -----------
> 
>     2 150
> 
>     3 632
> 
> -----------
> 
> Total 782
> 
> -----------
> 
> 
> 
> And an another (and last) question : how to delete the current selection?
> 
> Thank you.
> 
> Bernard Branger, Nantes, France
> 
> 
> 
> _______________________________________________
> EpiData-list mailing list
> EpiData-list at lists.umanitoba.ca
> http://lists.umanitoba.ca/mailman/listinfo/epidata-list


More information about the EpiData-list mailing list