Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: statalist-digest V4 #4433


From   "Seed, Paul" <paul.seed@kcl.ac.uk>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: statalist-digest V4 #4433
Date   Sun, 19 Feb 2012 20:20:21 +0000

On Sat, Feb 18 2012, David Cefskimal wrote:
> I am using the -cluster kmeans- command to look for opinion clusters
[...]
> kmeans- command. How to change the code including the weighting
> variable w1?

Asssuming that values of w1 are integer, David can use

expand w1
cluster kmeans v1 v2 v3 v4 v5 v6 if vC==1, k(4) 

If they are simple fractions, he can use 

gen w2 = w1*12
expand w1
cluster kmeans v1 v2 v3 v4 v5 v6 if vC==1, k(4) 



Any significance tests & confidence intervals will be invalid; but 
if you are using cluster solely as a descriptive tool, 
you won't want those anyway.

Paul Seed 

King's College London, Division of Women's Health
(& Department of Primary Care and Public Health Sciences)
St Thomas' Hospital, Westminster Bridge Road, London SE1 7EH
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index