turn on suggestions

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

Showing results for

Find a Community

- Home
- /
- BI
- /
- Visual Analytics
- /
- How to produce a time-series plot with different t...

Topic Options

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

Highlighted
# How to produce a time-series plot with different time variables?

[ Edited ]
Options

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

a week ago - last edited a week ago

Hello,

I'm trying to create a time-series plot, but the data has 4 variables for time, which is otherwise supposed to have one variable in which several levels are included. Here's an example:

data series;

input group $ time_1 time_2 time_3 time_4 @@;

datalines

A 1 1 0 1 A 1 0 0 1 A 0 1 0 1 A 1 1 0 0 A 0 0 1 0

B 0 0 1 0 B 1 1 0 1 B 1 0 1 1 B 1 0 1 0 B 0 1 0 1

C 0 1 0 0 C 1 1 1 1 C 1 1 0 0 C 1 0 1 0 C 0 0 1 1

; run;

At first, I want to calculate percentages for each time by group then I'm planning to plot a time-series throughout the time.

Or another possible answer I think is to make new data set in which a new time variable that has each time spot as its levels.

Here's an example:

data series_1;

input group $ time value @@;

datalines

A 1 1 A 2 1 A 3 0 A 4 1 A 1 1 A 2 0 A 3 0 A 4 1 A 1 0 A 2 1 A 3 0 A 4 1

A 1 1 A 2 1 A 3 0 A 4 0 A 1 0 A 2 0 A 3 1 A 4 0

B 1 0 B 2 0 B 3 1 B 4 0

...

C 1 0 C 2 0 C 3 1 C 4 1

; run;

I want the data to be transformed like this. How should I do this?

I'm also asking if there is any way to evaluate statistical significance of the difference in the percentage by group in the plot

Thank you.