jmp-l
[Top] [All Lists]

Re: How to change x axis values by another column?

To: jmp-l@lists.biostat.wustl.edu
Subject: Re: How to change x axis values by another column?
From: Fred Zhang <ieaggie2009@gmail.com>
Date: Wed, 18 Feb 2009 16:40:56 -0500
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=FjqotCJPVFGB5Mops//8RYSRiuk/gqqj6OitgRTM6rU=; b=sohYMrj5UjWm8Gkp+QkexFWxaX3blqp/YRap5VNEwWrQP2YOZ6HCrbDAH7UHEqkRf1 PhBSM3YOIC//onz8inCYhPv0pUl2mRrdXyO9WB/m1PujbeQSlxbVUO/CDMrceg8GmeW5 6/FxkhbxOaUKatu7v78sBtdMM/L0PFipfLmTw=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=TkxtogK13DztrJHZsUDb1Chqigd/syopw/n2Dt4DXQxaHkFlG/qpQk4joMyCNSlhY+ +LEEX7WjHmdeqvwTbkr62XnaO37+6L5QmN3Rxn2zXdJ4b/0utTStrbWWYtMQvuGckT3q IQ5QnUzrp8C7xOKS7nkx/sSRzBfibgDNISd40=
In-reply-to: <000001c9920d$b70bbe00$25233a00$@net>
References: <25e89e790902181117n7c9cad19s20a9ad85b67808e7@mail.gmail.com> <A4CE6EA1-AAD2-48C5-B156-27CBADE987E3@aol.com> <000001c9920d$b70bbe00$25233a00$@net>
Hi, Michael
 
I tried your code and always got following script error:
In my example, ID is a char type column, X and Y are both numeric columns.
I do not know what's wrong with Overlay Plot commend.
 
Thanks, Feng
---------------------------------------------------------------------

::biv << (curve[1] << save predicteds);

Overlay Plot(/*###*/X( :ID ),

Y( :Y, :Predicted Y ),



On Wed, Feb 18, 2009 at 4:13 PM, Michael Benson <mbenson@one.net> wrote:
Hi Mark and Fred. I thought of that too but it didn't seem to work. Maybe I
missed something. Instead here's a roundabout way of doing it. The idea is
to first do a bivariate fit of Y versus X, save the predicted values, then
do an overlay plot in such a way as to get the desired result using ID as
the X column. (Note that I relabled the columns ID, X, and Y.) Here's the
script:

biv = Bivariate( Y( :Y ), X( :X ), Invisible, Fit Line( {Line Color( "Red"
)} ) );
biv << (curve[1] << save predicteds);
Overlay Plot(
       X( :ID ),
       Y( :Y, :Predicted Y ),
       :Y( Overlay Marker Color( 0 ), Overlay Marker( 0 ) ),
       :Predicted Y(
               Connect Points( 1 ),
               Show Points( 0 ),
               Connect Color( 3 ),
               Overlay Marker( 1 )
       ),
       SendToReport(
               Dispatch(
                       {},
                       "101",
                       ScaleBox,
                       {Inc( 1 ), Minor Ticks( 0 ), Rotated Labels( 1 )}
               )
       )
);
Current Datatable()<<Delete Columns("Predicted Y")

There are some loose ends. The "invisible" reports do stick around and it
might make sense to get rid of them.

Michael

-----Original Message-----
From: jmp-l-owner@lists.biostat.wustl.edu
[mailto:jmp-l-owner@lists.biostat.wustl.edu] On Behalf Of Mark Bailey
Sent: Wednesday, February 18, 2009 3:56 PM
To: jmp-l@lists.biostat.wustl.edu
Subject: Re: [jmp-l] How to change x axis values by another column?

Did you try adding the Value Labels column property? This way you
associate the desired label with each numeric value.

Mark

On Feb 18, 2009, at 2:17 PM, Fred Zhang <ieaggie2009@gmail.com> wrote:

> Hi, I have the following 3 columns:
>
> Col_1          Col_2            Col_3
> 00Qtr1         1                   1.4
> 00Qtr2         2                   1.5
> 00Qtr3         3                   1.46
> 00Qtr4         4                   1.6
> 01Qtr1         5                   1.54
> 01Qtr2         6                   1.58
> 01Qtr3         7                   1.69
> 01Qtr4         8                    1.6
> 02Qtr1         9                    1.62
> ...                ....                 ...
> 08Qtr4        28                   2.48
> I have tried Fit Y(Col_3) by X(Col_2), because both are numeric data
> type, for linear regression.
> In the picture box or plot, I want to repley X axis values {1, 2, 3,
> 4, ....} by
> the values of Col_1, i.e. {00Qtr1, 00Qtr2, 00Qtr3, ...}
>
> So how to revise the following JSL code to do that?
>
> Thanks,
> Fred
> ---
> ---
> ---
> ---
> ---
> ---
> ---
> ---
> ---
> --------------------------------------------------------------------
>  biv Bivariate(
>  Y( : Col_3 ),
>  X( : Col_2 ),
>  Fit Line( {Line Color( "Red" )} ),
>  SendToReport(
>   Dispatch(
>    {},
>    "1",
>    ScaleBox,
>    {Scale( Linear ), Format( "Best" ), Min( 1 ), Max( 28 ),
>    Inc( 4 )}
>   ),
>   Dispatch(
>    {},
>    "2",
>    ScaleBox,
>    {Scale( Linear ), Format( "Numeric" ), Min( 0 ),
>    Max( 2.5 ), Inc( .5 )}
>   ),
>   Dispatch( {}, "Bivar Plot", FrameBox, Marker Size( 2 ) )
>  )
> );


<Prev in Thread] Current Thread [Next in Thread>