Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to use nonlinear least squares regression for a vector function?

    I am trying to fit the function:
    Revenuei(time) = A0/(1+exp(-A1*(time-A2))) + B*Costsi

    I have 5,000 observations of Revenue and Costs for 8 time periods (time = 0,1,...7).

    A0, A1, A2, and B are constants that I am trying to fit.

    I am unsure of how to fit this function in Stata using the nl command. Does anybody have suggestions?

    If I were to drop the term "B*Costsi" would I be able to fit the function using the average value of Revenue across all 5000 observations for each time period?
    Last edited by Jeffrey Weiner; 30 Mar 2019, 09:49.

  • #2
    You'll increase your chances of a useful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex. Have you carefully studied the nl pdf documentation? It seems straightforward.

    Comment

    Working...
    X