From: Jinto83 on
Hi,

Suppose I have a file like this:

Brand ReporterID SALE1998Q3 SALE1998Q4 SALE1999Q1 SALE1999Q2
Ford 2 200 300 400
Ford 1 200 500
Ford 3 300
Toyota 3 200 340 700
Toyota 2 100 250

How do I condense multiple brand information from different reporter sources into one observations. But Add a conflit_flag if there is disagreements among the diffrent reporters.

So the desired output file is:
Brand SALE1998Q3 SALE1998Q4 SALE1999Q1 SALE1999Q2 Conflit_in_reports
Ford 200 300 400 500 No
Toyota 100 200 340 700 Yes




--- news://freenews.netfront.net/ - complaints: news(a)netfront.net ---
From: Tom Abernathy on
You could use PROC MEANS/SUMMARY. If there is no disagreement then
the STD will be 0. If there are no missings then N will equal _FREQ_.


On Mar 13, 5:05 am, "Jinto83" <jint...(a)sina.com> wrote:
> Hi,
>
>    Suppose I have a file like this:
>
> Brand ReporterID  SALE1998Q3 SALE1998Q4 SALE1999Q1 SALE1999Q2
> Ford     2                200               300                  400                  
> Ford     1                200                                                              500
> Ford     3                                     300
> Toyota  3                                     200                  340                 700
> Toyota  2               100                250
>
> How do I condense multiple brand information from different reporter sources into one observations. But Add a conflit_flag if there is disagreements among the diffrent reporters.
>
> So the desired output file is:
> Brand   SALE1998Q3 SALE1998Q4 SALE1999Q1 SALE1999Q2  Conflit_in_reports
> Ford                200               300                  400                500      No
> Toyota            100               200                  340                 700      Yes
>
> --- news://freenews.netfront.net/ - complaints: n...(a)netfront.net ---

From: Jinto83 on
Thank you for your reply.
But How do I 'imprint', so to speak, the results of proc means into by group. So that whenever there is duplication in at least one of the SALE variables the flag variable would be set to 1?

"Tom Abernathy" <tom.abernathy(a)gmail.com> ???? news:40a6d75c-8bb7-4fe5-abbd-665c03c57e48(a)y17g2000yqd.googlegroups.com...
You could use PROC MEANS/SUMMARY. If there is no disagreement then
the STD will be 0. If there are no missings then N will equal _FREQ_.


On Mar 13, 5:05 am, "Jinto83" <jint...(a)sina.com> wrote:
> Hi,
>
> Suppose I have a file like this:
>
> Brand ReporterID SALE1998Q3 SALE1998Q4 SALE1999Q1 SALE1999Q2
> Ford 2 200 300 400
> Ford 1 200 500
> Ford 3 300
> Toyota 3 200 340 700
> Toyota 2 100 250
>
> How do I condense multiple brand information from different reporter sources into one observations. But Add a conflit_flag if there is disagreements among the diffrent reporters.
>
> So the desired output file is:
> Brand SALE1998Q3 SALE1998Q4 SALE1999Q1 SALE1999Q2 Conflit_in_reports
> Ford 200 300 400 500 No
> Toyota 100 200 340 700 Yes
>
> --- news://freenews.netfront.net/ - complaints: n...(a)netfront.net ---


--- news://freenews.netfront.net/ - complaints: news(a)netfront.net ---
From: Tom Abernathy on
On Mar 22, 12:29 pm, "Jinto83" <jint...(a)sina.com> wrote:
> Thank you for your reply.
> But How do I 'imprint', so to speak, the results of proc means into by group. So that whenever there is duplication in at least one of the SALE variables the flag variable would be set to 1?
>
> "Tom Abernathy" <tom.aberna...(a)gmail.com> ????news:40a6d75c-8bb7-4fe5-abbd-665c03c57e48(a)y17g2000yqd.googlegroups.com...
> You could use PROC MEANS/SUMMARY.  If there is no disagreement then
> the STD will be 0. If there are no missings then N will equal _FREQ_.
>
> On Mar 13, 5:05 am, "Jinto83" <jint...(a)sina.com> wrote:
>
>
>
>
>
> > Hi,
>
> > Suppose I have a file like this:
>
> > Brand ReporterID SALE1998Q3 SALE1998Q4 SALE1999Q1 SALE1999Q2
> > Ford 2 200 300 400
> > Ford 1 200 500
> > Ford 3 300
> > Toyota 3 200 340 700
> > Toyota 2 100 250
>
> > How do I condense multiple brand information from different reporter sources into one observations. But Add a conflit_flag if there is disagreements among the diffrent reporters.
>
> > So the desired output file is:
> > Brand SALE1998Q3 SALE1998Q4 SALE1999Q1 SALE1999Q2 Conflit_in_reports
> > Ford 200 300 400 500 No
> > Toyota 100 200 340 700 Yes
>
> > --- news://freenews.netfront.net/ - complaints: n...(a)netfront.net ---
>
> --- news://freenews.netfront.net/ - complaints: n...(a)netfront.net ---- Hide quoted text -
>
> - Show quoted text -

proc summary data=sales nway ;
class brand;
var sale: ;
output out=summary ;
run;

data flags;
set summary ;
where _stat_='STD';
conflict = max(of sale:) > 0 ;
keep brand conflict ;
run;