Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To: Get a better average
Message
De
02/02/2010 17:46:24
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01447163
Message ID:
01447197
Vues:
28
>Bruce
>
>
>>Why are you using only the previous 10 cases? Could you use more? Generally a minimum of 30 samples provides a better estimate, and that is in the case of a normal distribution.
>
>The number used is set by the user, most users have it set to 10, and 3 is the minimum we allow in the application setup. Now looking at the doctor who sent in the request, increasing the number of cases used in the average also increased the returned average time..just his example. I'm making a guess that the doctor is not happy about what time the system is saying is his average and was hoping for a lower number. In his case, the average is 44 for a specific procedure, when I increased it to 30, it went up to 49. Use the mode average, it returned 34.
>
>> I would guess that you have a positively skewed distribution (a case time can't be < 0, however it can be some arbitrarily large number). In that situation, median is probably a better estimate of "central tendency" than average.
>
>Correct on how the numbers work. We are leaning that the median solution might be a viable option.
>
>The interesting thing as we have reviewed their data, is that the scheduled time (duration based off our calculation) is within 4% of their actual time on the cases. So overall we feel we're pretty close.

If you have the data, it would be interesting to look at the distribution of the delta. i.e., If you record an actual time for each estimated time, what does the distribution of differences (acttual-estimated) look like? From your above statement, the average of that distribution is 4%. If the spread of that distribution is narrowly bounded, and centered on 0, I would agree, you are probably as close as you can get on your estimate. An interesting problem.



>>>
>>>declare @tiPerID int
>>>declare @tiProcID int
>>>set @tiPerID=1135
>>>set @tiProcID = 14161
>>>
>>>SELECT
>>>	avg(det.ortime) as AvgORMinutes
>>>	FROM (select top 10
>>>		dbo.meetings.enteror, dbo.meetings.exitor,
>>>		datediff(mi,enteror,exitor) as ORTime,meetproc.procid
>>>	      FROM   dbo.meetings (nolock) INNER JOIN
>>>		dbo.meetproc (nolock) ON dbo.meetings.meetingnumber = dbo.meetproc.meetingnumber
>>>	      WHERE  (dbo.meetproc.coperid = @tiPerID) AND (dbo.meetings.iscompleted = 1)
>>>		  AND  (dbo.meetproc.procid=@tiProcID)
>>>                  ------------------------------------------------
>>>                  -- Filter so we only include cases where this
>>>                  -- was the only procedure included on the case
>>>                  ------------------------------------------------
>>>		  AND (SELECT COUNT(*) 
>>>			FROM dbo.meetproc mp (nolock) 
>>>			WHERE dbo.meetings.meetingnumber = mp.meetingnumber
>>>			AND (dbo.meetproc.coperid = @tiPerID) 
>>>			AND  (dbo.meetproc.procid=@tiProcID)) = 1 
>>>	      ORDER BY endtime desc )det
>>>group by det.procid
>>>
>>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform