Hi,

I am trying to estimate a logit model using survey data. I have a categorical variable (age group) as independent variable, and a binary dependent variable that measures employment.
I would like to gather whether the difference between one category and a basecategory, let's say age group 2, is statistically significant by obtaining the p-value.
I would then like to write it to a matrix so that later I can export it to excel.

How would I go about writing this in code?
So far, all I have got is:

svy:logit Emp Age

local category=e(N_over)
local basecat=4

forvalues j = 1/`category' {
local dif`j'=p`i'[1,`j']-p`i'[1,`basecat']
local sedif`j'=sqrt(se`i'[1,`j']*se`i'[1,`j']+se`i'[1,`basecat']*se`i'[1,`basecat'])
matrix dfs`i'[`j',1]=`dif`j''
matrix dfs`i'[`j',2]=`sedif`j''
matrix dfs`i'[`basecat',1]=.
matrix dfs`i'[`basecat',2]=.
}
Also, I would like to know the nuber of observations used in the estimation process, by category.
Normally I'd say right after the logit command;
matrix n=e(N)
But how would I obtain the number of observations broken down by category?

Many thanks