Announcement

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

  • Changing all Harvest Units to Kilogram and Units for Its Price

    I will very much glad if I could receive help ,please.I am working on a plot level data to estimate yield of maize and revenue.
    Revenue = Harvest * Price of quantity per unit.

    This is the raw data for harvest.
    Click image for larger version

Name:	harv.JPG
Views:	1
Size:	47.4 KB
ID:	1432800


    Secondly this is the data for Price per Unit in(GHC) for the harvest,which I am interested in and the Unit(SAL14) below.The unit quantities are the same for both Harvest and Price Per unit Sold.

    price.JPG Click image for larger version

Name:	image_10106.jpg
Views:	1
Size:	49.3 KB
ID:	1432805


    My question relates to the revenue.The issue is that I observed that the average revenue is very high after changing all the units to kilogram.

    Basically, the harvest units are already converted by Harvard data verse(data source) and you can find it below.
    Click image for larger version

Name:	28117090_10208727507823510_483154809_n.png
Views:	1
Size:	8.7 KB
ID:	1432810

    My assumption is that 1 kilogram ==1000tonne
    Similarly 1 kilogram==100 since they have already provided the conversions for the harvest .
    This is the command i therefore used ,
    gen maize_har=.

    replace maize_har = maize_harvest*100 if CR13==1

    But for the PRICE per Unit I understand I need to make them one unit but I am not sure how to go about it .

    Two options tried,
    1.)Option 1- use the same formular for the harvest
    replace Price_GHC =Price_GHC *100 if SAL14==2
    replace Price_GHC =Price_GHC *75 if SAL14==3

    2.)Option 2) I used
    the unit price for kilogram to multiply all .eg gen Rev=maize_har*60 where 60 is the Unit Price for Kilogram Harvest

    outcome table
    Click image for larger version

Name:	outcome.png
Views:	1
Size:	29.8 KB
ID:	1432811


    Even still i observed the figures are still high.

    Question:What could i be doing wrong.
    Is there a problem with the way i changed the harvest into Kilogram?
    Is there a problem with the way I went about the price.I am not so sure about it.How can I go about the unit of the price since i have changed all the harvest to Kilogram.

    Thank you for your response .



    Last edited by Asare Michael; 05 Mar 2018, 08:39.

  • #2
    Your post is very confusing. First, of the four screenshots you posted, three are unreadable on my computer. This is typical of what happens with screenshots and which is why the Forum FAQ (which you were asked to read before posting) specifically asks people not to use screenshots to show data. There is a very easy-to-use tool for showing data here, the -dataex- command.

    In the future, when showing data examples, please use the -dataex- command to do so. If you are running version 15.1 or a fully updated version 14.2, it is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code.

    Certainly your assumption that 1 kilogram = 1000 Tonne is incorrect. It is the other way around: 1 Tonne (aka Metric Ton) = 1000 kilogram. And what does "Similarly 1 kilogram==100 " mean? 100 what? In any case, it is likely to be wrong, since the only unit which, when multiplied by 100 gives you a kilogram, and that would be the very little used dekagram.

    If these observations alone do not resolve your issue, please post back. When doing so, show your data using -dataex-, and when referring to constructs, state the names of the variables in your data that correspond. (And, similarly, when mentioning variable names, indicate what they represent in the real world, unless the name is self explanatory.)


    Comment


    • #3
      Thank you very much Schechter,I will look at it and post back using dataex.

      Comment

      Working...
      X