Re: cfvar

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: cfvar

Art Kendall
Since I did not understand your data I sent a simulation that might address your problem.
the syntax I posted does 3 things.  Makes up two groups of data. Does a t-test. Calculates two cfvars one for each group.

To run the set of syntax I posted.
-- go  to the email message
-- highlight the syntax in the email, copy it to the clipboard.

-- open a new instance of SPSS.  How to do this will depend on your kind of computer.
-- click <cancel> on the pop-up window
-- click <file> <new> <syntax>
-- on that window <paste> the syntax from the clipboard.
-- on the task bar click <run> <all>

-- look at the top part of the output.  You should see that two groups of data are simulated.
One is a pseudo-sample from a pop with a pop mean of 22 and pop sd of 5.
Another is a pseudo-sample from a pop with a pop mean of 27 and pop sd of 6.

Then there is a t-test between the two groups of data. This shows the sample means and sample SDs so you can hand calculate the cfvar.

In the output after the comment
*new stuff below.
is the syntax that would generate the cfvar for you.

This is the part you might be able to adapt to you particular situation.

Please give this syntax a try and let the list know if the approach using AGGREGATE would work for you.

If this is not the kind of thing you had in mind please let the list know that.

Art Kendall
Social Research Consultants

On 8/1/2011 11:47 AM, Jeremy Sloan wrote:
I cannot find the area that you specified that allows me to execute this script. However, I can send over a sample database. I'm looking, for instance, for the CoV for the jobcat variable. Let me know if that helps.

Thanks,
Jeremy

On Sat, Jul 30, 2011 at 9:57 AM, Art Kendall <[hidden email]> wrote:
It is unclear to me what your data look like, but this is a way to get a cfvar.  IIRC it is only valid when you have non-negative values.
Below there is simulation syntax for a t-test that I added an AGGREGATE to then did a COMPUTE and LIST.
Open a new instance of SPSS. Paste the syntax below into a syntax window. Run it.

Art Kendall
Social Research Consultants

* prepare two distributions as if for t-test.
set seed 20101802.
input program.
loop #i = 1 to 25.
compute group =1.
compute x = rv.normal(22,5).
end case.
end loop.
loop #i = 1 to 25.
compute group =2.
compute x = rv.normal(27,6).
end case.
end loop.
end file.
end input program.
T-TEST GROUPS=group(1 2) /variables = x.
*new stuff below.
aggregate outfile= */break = group
 /groupmean = mean(x)
 /groupsd = sd(x).
compute cfvar = groupsd/groupmean.
formats groupmean groupsd cfvar(f7.2).
list.


On 7/30/2011 9:01 AM, Jeremy Sloan wrote:
Rich,

Thanks for the response.

I'm trying to find the coefficient of variation for each different
type of bill. How many UB04 compared to 1500s? I added the other
columns myself just to see if I can run that function off of that.

 From what I'm reading for your post, it can only be done by hand in a
column. Is that correct?

Jeremy

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Art Kendall
Social Research Consultants