* Import data from an Excel file import excel "C:\Users\HuKang\Stata\workshop\PST_LN_status.xlsx", sheet("data") firstrow browse * Because data file is in the current working directory, the path is not needed clear import excel "PST_LN_status.xlsx", sheet("data") firstrow browse * Import data from a Tab delimited text file clear import delimited "C:\Users\HuKang\Stata\workshop\PST_LN_status.txt" browse * checking lesion data list Lesion Size1 if Lesion == "T1" list Lesion Size1 if Lesion == "T2" list Lesion Size1 if Lesion == "T3" by Lesion, sort: list Lesion Size1 * describe data content with codebook codebook Nodes NodeStatus codebook * summarizing data summarize Size1 Size2 Size3 sum Size1 Size2 Size3, detail * graphing data * boxplots graph box Size1 Size2 graph box Size1 Size2, over (Lesion) graph box Size2, over (NodeStatus) * two-way scatter (correlation) plot twoway (scatter Size3 Size2) twoway (scatter Size3 Size2) (lfit Size3 Size2) * Statistical analysis * Example 1 ttest Size1==Size2 if Lesion == "T1" ttest Size1==Size2 if Lesion == "T2" ttest Size1==Size2 if Lesion == "T3" by Lesion, sort: ttest Size1==Size2 * Statistical analysis oneway Size2 NodeStatus, tabulate