I want to calculate the ratios between the different diets based on the margins, which is no problem. I want a p-value, which I cannot get. Can you help me?

Option 1 – gives me ratios but no p-values.
// Fit the model
regress Ferritin_log i.Food_last_year BMI
// Calculate marginal means and store them in the coefficient table (so nlcom can access them)
margins i.Food_last_year, expression(exp(predict(xb))) post
// Ratio of No_red_meat to Omnivore
nlcom (ratio_no_red_meat_to_omnivore: M[1,2] / M[1,1])
// Ratio of Pescetarian to Omnivore
nlcom (ratio_pescetarian_to_omnivore: M[1,3] / M[1,1])
// Ratio of Vegan/Vegetarian to Omnivore
nlcom (ratio_vegan_veg_to_omnivore: M[1,4] / M[1,1])
Option 2 – gives me an error message.
// Fit the model
regress Ferritin_log i.Food_last_year BMI
// Calculate marginal means and store them in the coefficient table (so nlcom can access them)
margins i.Food_last_year, expression(exp(predict(xb))) post
// Ratio of No_red_meat to Omnivore
nlcom (ratio_no_red_meat_to_omnivore: _b[2] / _b[1])
// Ratio of Pescetarian to Omnivore
nlcom (ratio_pescetarian_to_omnivore: _b[3] / _b[1])
// Ratio of Vegan/Vegetarian to Omnivore
nlcom (ratio_vegan_veg_to_omnivore: _b[4] / _b[1])
Output:
Option 1 – gives me ratios but no p-values.
// Fit the model
regress Ferritin_log i.Food_last_year BMI
// Calculate marginal means and store them in the coefficient table (so nlcom can access them)
margins i.Food_last_year, expression(exp(predict(xb))) post
// Ratio of No_red_meat to Omnivore
nlcom (ratio_no_red_meat_to_omnivore: M[1,2] / M[1,1])
// Ratio of Pescetarian to Omnivore
nlcom (ratio_pescetarian_to_omnivore: M[1,3] / M[1,1])
// Ratio of Vegan/Vegetarian to Omnivore
nlcom (ratio_vegan_veg_to_omnivore: M[1,4] / M[1,1])
Option 2 – gives me an error message.
// Fit the model
regress Ferritin_log i.Food_last_year BMI
// Calculate marginal means and store them in the coefficient table (so nlcom can access them)
margins i.Food_last_year, expression(exp(predict(xb))) post
// Ratio of No_red_meat to Omnivore
nlcom (ratio_no_red_meat_to_omnivore: _b[2] / _b[1])
// Ratio of Pescetarian to Omnivore
nlcom (ratio_pescetarian_to_omnivore: _b[3] / _b[1])
// Ratio of Vegan/Vegetarian to Omnivore
nlcom (ratio_vegan_veg_to_omnivore: _b[4] / _b[1])
Output:

Comment