<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Methods for assessing lag variables in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Methods-for-assessing-lag-variables/m-p/250738#M49221</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a script that allows you to create lag columns save on the community (&amp;nbsp;&lt;LI-MESSAGE title="Create multiple lag columns" uid="234091" url="https://community.jmp.com/t5/JMP-Scripts/Create-multiple-lag-columns/m-p/234091#U234091" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;).&amp;nbsp; Does that help?&lt;/P&gt;</description>
    <pubDate>Thu, 05 Mar 2020 13:59:23 GMT</pubDate>
    <dc:creator>HadleyMyers</dc:creator>
    <dc:date>2020-03-05T13:59:23Z</dc:date>
    <item>
      <title>Methods for assessing lag variables</title>
      <link>https://community.jmp.com/t5/Discussions/Methods-for-assessing-lag-variables/m-p/250660#M49204</link>
      <description>&lt;P&gt;Do any of the gurus on here have an easy way to adjust columns based on some hypothesized lag. &amp;nbsp;Example situation: Trying to determine the impact of factors on sales, and some of the factors have been hypothesized to have a lag effect (e.g., 1 wk, 2 wk, 1 month, 1 qtr). So, for example, if we want to determine the effect of some variable (e.g., reviews, price, stars, etc.), but it takes "x" time (would like to easily vary this) for the variables change to take effect. &amp;nbsp;I basically have to shift the data in columns to see these lag effects...anyone got a better idea? &amp;nbsp;TIA!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 20:39:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Methods-for-assessing-lag-variables/m-p/250660#M49204</guid>
      <dc:creator>statman</dc:creator>
      <dc:date>2020-03-04T20:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Methods for assessing lag variables</title>
      <link>https://community.jmp.com/t5/Discussions/Methods-for-assessing-lag-variables/m-p/250680#M49209</link>
      <description>&lt;P&gt;It would be very easy to setup new columns for the different weeks, or to setup a binning column for the different weeks, and then to analyze the data.&amp;nbsp; And that would be a good approach&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 21:31:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Methods-for-assessing-lag-variables/m-p/250680#M49209</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-03-04T21:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Methods for assessing lag variables</title>
      <link>https://community.jmp.com/t5/Discussions/Methods-for-assessing-lag-variables/m-p/250738#M49221</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a script that allows you to create lag columns save on the community (&amp;nbsp;&lt;LI-MESSAGE title="Create multiple lag columns" uid="234091" url="https://community.jmp.com/t5/JMP-Scripts/Create-multiple-lag-columns/m-p/234091#U234091" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;).&amp;nbsp; Does that help?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 13:59:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Methods-for-assessing-lag-variables/m-p/250738#M49221</guid>
      <dc:creator>HadleyMyers</dc:creator>
      <dc:date>2020-03-05T13:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Methods for assessing lag variables</title>
      <link>https://community.jmp.com/t5/Discussions/Methods-for-assessing-lag-variables/m-p/250832#M49241</link>
      <description>&lt;P&gt;Thanks for your responses. I can setup new columns and shift the data manually (that's what I already do), but I was looking for a simple dialog that quickly lags a column a specified number of days/weeks/months/ etc. The script lets you start the lag after a specified number, but then goes by one row at a time.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 15:04:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Methods-for-assessing-lag-variables/m-p/250832#M49241</guid>
      <dc:creator>statman</dc:creator>
      <dc:date>2020-03-05T15:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Methods for assessing lag variables</title>
      <link>https://community.jmp.com/t5/Discussions/Methods-for-assessing-lag-variables/m-p/250838#M49244</link>
      <description>&lt;P&gt;Can you please provide a description of you data table, or better yet, a sample of your data table.&amp;nbsp; Without that, one can only guess what your data are, and what JSL is required to setup the lag columns.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 15:32:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Methods-for-assessing-lag-variables/m-p/250838#M49244</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-03-05T15:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: Methods for assessing lag variables</title>
      <link>https://community.jmp.com/t5/Discussions/Methods-for-assessing-lag-variables/m-p/250844#M49248</link>
      <description>&lt;P&gt;Yes, of course. &amp;nbsp;First just a typical scenario...I am interested in the response variable of number of units sold (appliances). &amp;nbsp;I have this recorded in a column. &amp;nbsp;I have another column for statistics on housing starts. &amp;nbsp;I hypothesize that appliance sales do not occur at the housing start, but at some time interval multiple months from housing starts, so I want to lag the actual units sold column a number of months (and be able to vary this by different time series). &amp;nbsp;For the greatly reduced attached data set, there is a column of reviews, columns of "events", a column of units sold (Y) and Units sold lagged by 7 days (Yl). &amp;nbsp;The units don't actually sell when the events or reviews occur, but are lagged. &amp;nbsp;So the questions we are trying to answer are:&lt;/P&gt;&lt;P&gt;1. Do the events have a significant effect on units sold? If you correspond the units sold with the same row of the event, this assumes the sales occur simultaneously (on the same day) which may be non-sensical.&lt;/P&gt;&lt;P&gt;2. How much lag is there from "event" to change in units sold? &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 15:56:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Methods-for-assessing-lag-variables/m-p/250844#M49248</guid>
      <dc:creator>statman</dc:creator>
      <dc:date>2020-03-05T15:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Methods for assessing lag variables</title>
      <link>https://community.jmp.com/t5/Discussions/Methods-for-assessing-lag-variables/m-p/250863#M49257</link>
      <description>&lt;P&gt;Here is a simple script that creates a new lag column based upon the a specified number of weeks.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

dtTemp = dt &amp;lt;&amp;lt; Subset(invisible, All rows, columns( :Date, :Yl ), output table("Lag Table") );
dtTemp:Yl &amp;lt;&amp;lt; set name("4 Week Lag Y1");

dtTemp &amp;lt;&amp;lt; New Column( "Lagged Date ", formula(:Date), format("m/d/y",10));

For Each Row(
	dtTemp:Date = dtTemp:Date + In weeks(4);
);

dtJoined = dt &amp;lt;&amp;lt; Join(
	With( dtTemp ),
	By Matching Columns( :Date = :Date ),
	Drop multiples( 0, 0 ),
	Include Nonmatches( 0, 0 ),
	Preserve main table order( 1 ),
	Merge Same Name Columns( 1 ),
	Match Flag( 0 )
);

close( dtTemp, nosave );

dtJointed = Bivariate(
	Y( :Yl ),
	X( :Name( "4 Week Lag Y1" ) ),
	Fit Line( {Line Color( "Medium Dark Red" )} )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Mar 2020 16:48:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Methods-for-assessing-lag-variables/m-p/250863#M49257</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-03-05T16:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Methods for assessing lag variables</title>
      <link>https://community.jmp.com/t5/Discussions/Methods-for-assessing-lag-variables/m-p/250898#M49265</link>
      <description>Jim,&lt;BR /&gt;Thanks for the effort. Perhaps I don't understand what the script is doing, but I just want the script to allow for selection of columns and to specify the number of weeks to create the new column. There are no options when I run this script. I don't want any particular analysis performed.</description>
      <pubDate>Thu, 05 Mar 2020 18:45:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Methods-for-assessing-lag-variables/m-p/250898#M49265</guid>
      <dc:creator>statman</dc:creator>
      <dc:date>2020-03-05T18:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Methods for assessing lag variables</title>
      <link>https://community.jmp.com/t5/Discussions/Methods-for-assessing-lag-variables/m-p/250902#M49267</link>
      <description>&lt;P&gt;The script is a simple example of how you can create a new data table with a 4 week lag in units sold.&amp;nbsp; The graph was just a simple plot of the original values vs. the lagged values.&lt;/P&gt;
&lt;P&gt;The assumption of my script, was to provide you with the starting of a script that you could put together to meet your specific needs.&lt;/P&gt;
&lt;P&gt;But it is not the solution if you are looking for someone in the Discussion Community to write for you a specific application.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 19:11:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Methods-for-assessing-lag-variables/m-p/250902#M49267</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-03-05T19:11:57Z</dc:date>
    </item>
  </channel>
</rss>

