Simple linear regression with Gretl (no programming required)

Home Forums Linear Regression Simple linear regression with Gretl (no programming required)

Viewing 1 post (of 1 total)
  • Author
  • #1440
    Charles Durfee

    Gretl is a free open source statistical analysis tool, similar to SAS. You can download it here.

    You can download the dataset here.

    Step 1 Open file:
    File> Open Data> User File> Select Salary_Data.csv (you may need to change the drop down to “Select all files”)
    Click “No” when asked “Do you want to give the data a time-series or panel interpretation)

    Step 2 Run model:
    Model> Ordinary Least Squares
    Select “Salary” as Dependent variable
    Select “YearsExperience” as Regressors
    Click “Ok”
    Note smaller the p-value the better: must be lower than 0.05 to be significant.
    Note under the coefficient heading: const is the starting salary with no experience, YearsExperience is the amount added for each year(slope of the line).
    Note the R-Squared value closer to 1 is better

    Step 3 Graph Model:
    Analysis> Forecast
    Note the blue line is the models prediction for the salary
    Note there is a 95% chance that the salary will be between the green lines

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.