Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9185613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:19:14+00:00 2026-06-17T19:19:14+00:00

I have an outcome variable x and three explanatory variables a, b, c which

  • 0

I have an outcome variable x and three explanatory variables a, b, c which are categorical variables. In my example a has 8 levels, b has 4 levels and c has 35 levels, but not all combinations of the three variables has observations (this is probably unimportant).

If I run the following additive ANOVA model in Stata

anova x a b c
adjust, by(a b) gen(y)

then I obtain predictions of the variable x adjusted by the variables a and b. The adjust command outputs the following table in the Result window, and also it generates a variable y with adjusted predictions.


      |                 b                 
    a |       2        4        8       16
----------+-----------------------------------
   50 | .016655  .018487                  
   75 | .008286  .011237                  
  100 | .005937  .006677  .012467         
  150 | .001905  .004038  .009454         
  200 | .001774  .003107  .007592  .010081
  400 |          .004982  .006853  .009342
  800 |                   .002126   .00521
 1000 |                   .002732  .005221
----------------------------------------------
 Key:  Linear Prediction

My problem is that the variable y has a value for each combination of a, b and c while the table above only has values for each combination of a and b. How can I save the results from the table, so I’m able to work with these? What is the connection between the values in the table and the values in y?

Thanks in advance.

Update: I found this in help adjust:

Variables used in the estimation command but not included in either the by() variable list or the adjust variable list are left at their current values, observation by
observation. Here adjust displays the average estimated prediction (or the corresponding probability or exponentiated prediction), substituting the mean of these unspecified variables within each group defined by the variables
in the by() option.

This is also true for my data. For example if a=75 and b=2, then c takes on the values 12,13,14,15,16. The value of y corresponding to c=14 (which is the average) is exactly what is displayed in the table. But what if the average of the values is not a value that it takes on?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:19:15+00:00Added an answer on June 17, 2026 at 7:19 pm

    This is a reply to Stefan Hansen’s comment on adjust and margins.

    In general, no; but everything depends on the model and whether there are covariates other than those named. But consider the results of

    sysuse auto, clear 
    anova mpg foreign rep78
    adjust, by(foreign rep78)
    margins foreign#rep78
    

    Here the results do coincide.

    I am not fluent in margins beyond elementary uses, so any more complicated questions will need to be handled by someone else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a vector which holds pointers pointing to dynamic memory but also
guys, I have a problem, please help me! I have a CString variable which
I have an interceptor that logs the outcome of Spring MVC responses. All my
Desired Outcome I want to have Vertical List with custom items on the left/right
Say that you have a loop and depending on the outcome of the loop
I have created a listview using following tutorial link http://www.ezzylearning.com/tutorial.aspx?tid=1763429 Outcome of this is,
So I have the following XML chain: $xml->assessment->outcomes_processing->outcomes->decvar->attributes()->cutvalue XML example In Some XML-files $xml->assessment->outcomes_processing->outcomes->...
have written this little class, which generates a UUID every time an object of
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
Have deployed numerous report parts which reference the same view however one of them

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.