Help using Base SAS procedures

variance and confidence intervals

Reply
Contributor
Posts: 73

variance and confidence intervals

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
Super User
Posts: 17,784

Re: variance and confidence intervals

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.
Contributor
Posts: 73

Re: variance and confidence intervals

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
Super Contributor
Posts: 281

Re: variance and confidence intervals

Fred, this example of data doesn't answer any of my questions.
Super Contributor
Posts: 281

Re: variance and confidence intervals

> 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
Contributor
Posts: 73

Re: variance and confidence intervals

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
Super Contributor
Posts: 281

Re: variance and confidence intervals

> 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.
Super User
Posts: 17,784

Re: variance and confidence intervals

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 Smiley Sad

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.
Super User
Posts: 9,676

Re: variance and confidence intervals

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
Super Contributor
Posts: 281

Re: variance and confidence intervals

> 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
Super User
Posts: 9,676

Re: variance and confidence intervals

:-)
Ask a Question
Discussion stats
  • 10 replies
  • 155 views
  • 0 likes
  • 4 in conversation