Announcement

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

  • create a 3d graph

    Hello, I wish you all are doing well. I have a question regarding the 3d graph. I am working on a panel data for Croatian firms (period 2003-2012). I would like , as in other studies to present a 3d graph: to present the values of total factor productivity (lntfp) as a function of two other variables (ln_k and ln_m) which are respectively capital and intermediate inputs. Below you can find my code.. I would appreciate any help..

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int year float(lntfp ln_y ln_k ln_m)
    2003 10.859044 12.657664  10.28377 12.301568
    2005 10.914675 12.808443 11.326838  11.50916
    2006 11.071823 12.868095 10.258025 11.624117
    2007 10.738537  12.68928 10.432906 12.374198
    2008  11.08395 13.193436 10.932445 10.344658
    2009 10.910237 13.034134 11.090424 11.404673
    2010  10.87552 12.882734    11.052 11.479472
    2011 11.103927 12.861953  11.79645 11.439564
    2012  11.11536 12.904534 12.137916 11.429256
    2003   10.9419 13.096312 11.424943  14.39393
    2004 11.094778 13.135178 11.415795 14.493232
    2005 11.189354 13.332171  11.29785 14.625318
    2006 11.492964  13.48804  9.678206 14.642549
    2007 11.505796 13.497202  9.637977  14.46572
    2008 10.997793  13.03703 10.162336 14.375352
    2010 10.651668 12.593917 10.339805 14.130438
    2011  10.71319 12.490707 10.052423 13.830235
    2012 10.488406  11.95751  11.38832   12.9434
    2003 10.746325 12.550954 12.307332  11.20872
    2005 10.732097  12.72025 12.361547 11.732304
    2006  11.20767 13.170376 12.082575  11.55001
    2008 11.244648 13.148018 11.432096 11.528428
    2003 11.054091 13.454552 15.363012 13.837875
    2004  10.96959 13.511988 15.678285 13.401445
    2005  11.02972 13.575118 15.711184 13.099366
    2006 10.402132 12.971395 15.972814  13.01041
    2007 11.141938 13.820026 16.116816 13.335745
    2008 11.189402 13.858191 16.014883 13.004917
    2009 10.820186 13.481372 15.931527  12.65766
    2010 10.751976  13.40948 15.891168  12.83209
    end

  • #2
    When data are at least a bit noisy, direct 3D representations -- whether as perspective views or as contours -- aren't always terribly helpful. I think I know just enough economics (a dangerous state) to recognise predicting productivity from inputs as a classic regression problem. What's therefore likely to be far more useful in my view is to run a regression and then plot up the results as added variable plots. A plane with all variables logged seems traditional here, but the best summary would be two added variable plots, one for each predictor.

    I don't know what you intend -- focus on particular years, particular panels, or lumping all together -- so I will leave the advice there.
    Last edited by Nick Cox; 08 Oct 2018, 06:24.

    Comment


    • #3
      Nick thank you for your reply.. I wanted to create a 3d graph like the one in this paper https://www.theigc.org/wp-content/up...ohn-Petrin.pdf page 332.

      Comment


      • #4
        That link looks like a violation of JSTOR terms and conditions. That's IGC's problem rather than yours, but as FAQ maintainer I can't encourage people to cite material which may violate terms and conditions.

        Rather than expect that people open up a paper and read it, why not give a brief summary of what is being done?

        At a wild guess, using npregress and then twoway contour on the predictions might be a good bet in Stata terms. (I personally think that these graphs alone [NB] are too bumpy to be acceptable as showing intelligible functional relationships and too smoothed to be faithful to data.I don't ever want to see a smooth without seeing the data too.)

        Comment


        • #5
          Klodi: I agree with Nick's points. I would also suggest that you have a look at the Forum FAQ advice about how to post effectively. In particular, ensure you've searched easily-available resources before formulating your post. Have you done a search 3d for instance, and followed the links?

          Comment


          • #6
            [deleted]

            Sorry, I didn't read the "twoway contour" reply...
            Last edited by Matteo Bulgarelli; 31 May 2022, 02:49.

            Comment

            Working...
            X