Friday, 14 May 2010

Sampling definitions

Want to learn basics of sampling in surveys?

Here are some simple ones: http://www.gifted.uconn.edu/siegle/research/Samples/purposivesampling.htm

Thursday, 4 March 2010

Really useful site on SPSS

Check this out for a comprehensive and easy to use guide on SPSS command.

http://www.lrz-muenchen.de/~wlm/ein_spss.htm

Friday, 6 November 2009

Creating a string variable to calculate BTH participation till 2006

*Create a string variable by the name years. The variable a width of 7 characters but i ended up using just one. Then Use IF command to assign "1" to the variable in all cases where the year was less than 2006.*****

string years (A7).

if year1="2001-02" | year1="2002-03" | year1="2003-04" | year1="2004-05" | year1="2005-06" years="1".
if year2="2001-02" | year1="2002-03" | year1="2003-04" | year1="2004-05" | year1="2005-06" years="1".
if year3="2001-02" | year1="2002-03" | year1="2003-04" | year1="2004-05" | year1="2005-06" years="1".
if year4="2001-02" | year1="2002-03" | year1="2003-04" | year1="2004-05" | year1="2005-06" years="1".
if year5="2001-02" | year1="2002-03" | year1="2003-04" | year1="2004-05" | year1="2005-06" years="1".

fre years.

list Year1 Year2 Year3 Year4 Year5 TotalYears years.

**Frequency of only those cases who meet the above criteria, ie less than 2006********.

temp.
select if years="1".
fre TotalYears/sta=all.

Wednesday, 16 September 2009

Really basic stats: what can we do with these variables?

Here is a quick guide for statistics that are ok to compute with kind of variable:

OK to compute.... Nominal Ordinal Interval Ratio
frequency distribution. Yes Yes Yes Yes
median and percentiles. No Yes Yes Yes
add or subtract. No No Yes Yes
mean, standard deviation, standard error of the mean. No No Yes Yes
ratio, or coefficient of variation. No No No Yes

Source: http://www.graphpad.com/faq/viewfaq.cfm?faq=1089

Thursday, 9 July 2009

More on CTABLES





*This is the command for the above table.
CTABLES
/TABLE ( Q30n + Q32n + Q34n + Q36n + Q38n + Q40n + Q41n +Q42n ) [COUNT COLPCT]
/CATEGORIES VARIABLES= Q30n Q32n Q34n Q36n Q38n Q40n Q41n Q42n [1, 2, 3, 4, SUBTOTAL, OTHERNM] EMPTY=INCLUDE POSITION=AFTER.

First attempt at CTABLES

I am a big fan of SPSS TABLES, so it took me a while to accept the shift from TABLES to CTABLES. However, I dedicated my morning to get around ctable using the Table builder and then pasting the Syntax. Here is the first syntax I used:

* Custom Tables.

CTABLES
/VLABELS VARIABLES=Q1n Q5n1 Q2n1 DISPLAY=DEFAULT
/TABLE Q1n [C] > Q5n1 [C][COUNT F40.0, COLPCT.COUNT PCT40.1] BY Q2n1 [C]
/CATEGORIES VARIABLES=Q1n ORDER=A KEY=VALUE EMPTY=INCLUDE TOTAL=YES POSITION=AFTER
/CATEGORIES VARIABLES=Q5n1 [1, 2, 3, SUBTOTAL, OTHERNM] EMPTY=INCLUDE POSITION=AFTER
/CATEGORIES VARIABLES=Q2n1 [1, 2, 3, 4, 77, OTHERNM] EMPTY=INCLUDE TOTAL=YES POSITION=AFTER.

*The easiest command would be:
CTABLES /TABLE VAR1 [COLPCT] BY VAR2.


*AND ALSO with simplification the following.

CTABLES
/VLABELS VAR= Q1n Q5n1 Q2n1 DISP=DEFAULT
/TAB Q1n>Q5n1 [COUNT F5.0, COLPCT.COUNT] BY Q2n1
/CAT VAR=Q5n1 [1,2,3, SUBTOTAL] POSITION=AFTER.

* The best part about this syntax is the ability to create SubTotals for the dependent variable which I was unable to do before!

I still need to figure out some more things, including how to use multiple choice questions!