Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Forecasting
- /
- Re: Help with SAS code

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 10-26-2012 06:11 PM
(727 views)

Hi,

Can someone please help me with the following coding?

I need to create a data set of 1000 values for the following model:

X(t) = (1/((1-x)**0.4))e ,where e is a standard normal random variable and **L is the lag operator**. I don't know how to deal with the lag operator. finally I need to plot X vs. t.

But I need use the **1st 100 terms of the INFINITE BINOMIAL** expansion of the term (1/((1-x)**0.4)).

Thanks .

1 REPLY 1

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Dear malakaext,

Since I can't observe the lag operator in your expression, I'll try to explain you the usage of lag function in general.

x = lagN(varname); - this will produce the value of 'varname' on a step t - N.

So y = x(t-1) will be

y = lag1(x);

y = x(t-3) will be

y = lag3(x);

etc.

**Notice:** consider reading help about lag function and using it in conditional statements.

The example:

X(t) = (1/((1-X(t-1))**0.4))* e;

data Xmodel;

var t X e;

do t = 1 to 1000;

e = rand('NORMAL', 0, 1);

X =( 1/( (1 - coalesce(lag1(X),0))**0.4 ) ) * e ;

output;

end;

run;

📢

**ANNOUNCEMENT**

The early bird rate has been extended! Register by March 18 for just $695 - $100 off the standard rate.

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.** **

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.