Your data file should be a .csv file with variable names in the first row. To create a .csv file, enter your variable names and data into a spreadsheet, display cells in general format, do a Save As from the File menu and choose the "Comma Separated Values" option. More detailed instructions are available.
My data file is on ...
One variable in your data file is Y, the response variable, also called the dependent variable. One or more variables in your data file are the X variables, the predictor variables, also called the independent or explanatory variables.
Specify the names of the Y variable and at least one X variable, exactly as they appear in the first line of your data file.
The created R program is color coded to assist in understanding. Blue: Keyword for a function name from the R language Red: Variable or other name Gray: Comment Black: User supplied values that can be changed