LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 947
Default median of combinations from values in a column

Just curious. Can SPSS read in that many records at once?

=COMBIN(66,7) = 778,789,440

Here is just an idea. I don't know if it is of any use though.
If you are generating "Subsets" of size 4 in lexicographical order (ie
sorted) and use 4 variables a,b,c,&d,
then the mean is (a+b+c+d)/4
and the median is (b+c)/2

You execute division 1,557,578,880 times, and store real numbers in your
file.
Another idea might be to store integer values. ie just store (a+b+c+d) and
(b+c) in the text file, and see if SPSS can divide your final answers by 4
and 2.

This is not quite the code I use for Subsets, but here is a general idea for
outputting to a text file.
This is a simple idea that I'm sure you could modify.
Given a set 1-6, this generates "Subsets" of size 4.
However, this does "NOT" divide the sums by 4 and 2.
The "Mean" and "Median" go to different files.

Sub Demo()
Dim a As Long
Dim b As Long
Dim c As Long
Dim d As Long

Dim n As Long
Dim z As Long

Dim FileMean
Dim FileMedian

n = 6
z = n + 1

ChDir "C:\Temp"
FileMean = FreeFile
Open "Mean" For Output As #FileMean

FileMedian = FreeFile
Open "Median" For Output As #FileMedian

For a = 0 + 1 To n - 3
For b = a + 1 To n - 2
For c = b + 1 To n - 1
For d = c + 1 To n

Write #FileMean, a + b + c + d '(/4 if you wish)
Write #FileMedian, b + c '(/2 if you wish)

Next d, c, b, a
Close
End Sub

--
HTH :)
Dana DeLouis


wrote in message
...
In addition, is it possible to show *only* the median? This would make
it easier in terms of importing to SPSS later.

Andreas


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
find for non zero values in a column Median,Mode,STDEV Billp Excel Worksheet Functions 2 June 24th 09 03:20 PM
Find the median 3 values Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 6 November 20th 07 07:13 PM
How to display graph if only mean, SD & median values available? A Renshaw Charts and Charting in Excel 2 November 3rd 06 04:24 PM
Counting values lower then the median. [email protected] Excel Worksheet Functions 4 April 18th 06 09:14 PM
Median ignoring Zero Values tlosgyl3 Excel Worksheet Functions 4 October 13th 05 09:14 PM


All times are GMT +1. The time now is 06:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"