Exploring, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

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

Reply
Highlighted
Occasional Contributor
Posts: 6

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

[ Edited ]

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.

Ask a Question
Discussion stats
  • 0 replies
  • 91 views
  • 0 likes
  • 1 in conversation