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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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