BookmarkSubscribeRSS Feed
fredbell
Fluorite | Level 6
Hello

I have two sources of data that should both over the month have totals very close.

What is the best procedures to use to compute the variance of the difference and compute a confidence interval around that difference?

Help Please.

Fred
10 REPLIES 10
Reeza
Super User
Are you looking to compare the totals, which are two numbers or a series of numbers?

ie data set1
month1 3
month2 5
month3 5

data set2
month1 4
month2 9
month3 3

If so use the Procedure TTEST with paired options, but you will have to combine the data first.

Proc compare will compare the differences between two dataset values, but not variance.

If just two values you can't calculate variance.
fredbell
Fluorite | Level 6
Example of two different data sources of same information.
Actual date range would be for example Jan-01-10 through Mar-01-10.

Source A Source B

Date Amount Date Amount


Jan-01-10 123231 Jan-01-10 123231
Jan-02-10 272626 Jan-02-10 272726
Jan-03-10 263736 Jan-03-10 263736
Jan-04-10 264564 Jan-04-10 264564
Jan-05-10 352435 Jan-05-10 352445
Jan-06-10 736355 Jan-06-10 736320
Jan-07-10 142336 Jan-07-10 141336
Jan-08-10 112435 Jan-08-10 112500


Fred
Paige
Quartz | Level 8
Fred, this example of data doesn't answer any of my questions.
Paige
Quartz | Level 8
> What is the best procedures to use to compute the
> variance of the difference and compute a confidence
> interval around that difference?

Variance of the difference of means?

Variance of the difference of totals?

Variance of the differences of the individual month data?

Compare variance of group 1 to variance of group 2 (which would not be done via a difference)? Message was edited by: Paige
fredbell
Fluorite | Level 6
Sorry Paige the boss did not confirm, will it effect the Proc ttest paired that was suggested by Reeza?

Fred Message was edited by: fredbell
Paige
Quartz | Level 8
> Sorry Paige the boss did not confirm, will it effect
> the Proc ttest paired that was suggested by Reeza?

If you do a t-test and answer the wrong question, the results are meaningless.
Reeza
Super User
Paige is correct.

It really depends on the type of question you're trying to answer.

Looking at your data I see two possible questions:

1) Are the two data sources the same?
2) Are the monthly values the same for different areas of a call center?

I interpreted this as 2, but it could easily be 1 and it changes how you deal with things. Or any number of things I can't even think of...and you previously mentioned monthly totals but have daily data 😞

Perhaps state the LOGIC/business problem you're trying to solve, along with the SAS steps you're having issues? Helping you do the wrong thing doesn't help anyone.
Ksharp
Super User
Hi.
From your data structure ,I guess your data is matched data,right?
if it is so, then first calculate the difference of these two variables ( i.e. dif=var1-var1),
then for this dif using proc ttest or using proc n1parway Wilcoxon-rank-sum-test(strongly reference to, for the sake of nonparameter method).


Ksharp
Paige
Quartz | Level 8
> Hi.
> From your data structure ,I guess your data is
> matched data,right?
> if it is so, then first calculate the difference of
> these two variables ( i.e. dif=var1-var1),
> then for this dif using proc ttest or using proc
> n1parway Wilcoxon-rank-sum-test(strongly reference
> to, for the sake of nonparameter method).

All of this might make sense in some situations, but the original request was to compute a variance, not compare means. Which is why I keep asking for clarification on exactly what the user wants.

Message was edited by: Paige

Message was edited by: Paige Message was edited by: Paige

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 10 replies
  • 2083 views
  • 0 likes
  • 4 in conversation