You can plot a regression line or "linear fit" with the lfit command followed, as with scatter, by the variables involved. Regression attempts to find the line that best fits these points. The distribution of the points suggests a positive relationship between height and weight (i.e. The first variable you list will be the Y variable and the second will be the X variable. To create a scatterplot, use the scatter command, then list the variables you want to plot. If you plan on applying what you learn directly to your homework, create a similar do file but have it load the data set used for your assignment. Then create a do file called scatter.do in that folder that loads the GSS sample as described in Doing Your Work Using Do Files. If you plan to carry out the examples in this article, make sure you've downloaded the GSS sample to your U:\SFS folder as described in Managing Stata Files. This section will teach you how to make scatterplots Using Graphs discusses what you can do with a graph once you've made it, such as printing it, adding it to a Word document, etc. If you believe there is a causal relationship between the two variables, convention suggests you make the cause X and the effect Y, but a scatterplot is useful even if there is no such relationship. One variable is designated as the Y variable and one as the X variable, and a point is placed on the graph for each observation at the location corresponding to its values of those variables. If you are new to Stata we strongly recommend reading all the articles in the Stata Basics section.Ī scatterplot is an excellent tool for examining the relationship between two quantitative variables. The chart generated by the above data are shown below.This article is part of the Stata for Students series. Dates of Data Collection: enter the dates of data collection optional, if printed will appear in the lower left-hand corner of the chart.Enter Title and Labels: enter the title, y-axis label, and x-axis label there is no default title, but the default for the y-axis is “Y” while the default for the x-axis is the first cell in the column containing the x values.Enter range: enter the worksheet range containing the data and the headings the data must be in columns with the x values in the first column followed by the y values in adjacent columns the default is the range selected on the worksheet.The default is the range selected on the worksheet. The following input box is used to enter the range containing the data and the headings. Select the “Plot Multiple Y Variables Against One X Variable” option and then OK.ĥ. Select “Correlation” from the “Statistical Tools” panel on the SPC for Excel ribbon.Ĥ. Select the data and the column headings.ģ. Enter the data into a worksheet as shown below. The data can be downloaded at this link.Ģ. The experimenter wants to compare the measured amps to the theoretical amp.ġ. An example of how to create this chart is given below for plotting two Y variables against the X variable.Īn experiment has been to do to measure the amps from a process over time. The Y variables must be in adjacent columns. The data for this chart must be in columns with the X variable in the first column. The program will plot multiple Y variables against one X variable.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |