Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

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

# Re: st: RE: statalist-digest V4 #4433

 From Steve Samuels To statalist@hsphsun2.harvard.edu Subject Re: st: RE: statalist-digest V4 #4433 Date Mon, 20 Feb 2012 20:17:44 -0500

```Good idea, Paul. And if the weights are not integers, David can expand to frequency weights equivalent to the original weights to any chosen number of decimal places (pointed out by Austin Nichols).

So, for k decimal places, use
new frequency weight = round(10^k * probability weight,1)

For example, for k = 1, 23.43 -> 234  a whole number.

As long as all weights are over 1, I'd guess that k= 0 (round to nearest integer) or k = 1 would be sufficient.

Steve
sjsamuels@gmail.com

On Feb 19, 2012, at 3:20 PM, Seed, Paul wrote:

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/

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index