SAS Report about Analysis and Writing R Code

SAS Report about Analysis and Writing R Code

  1. Procreg data=class;

Model Wght=Height;


Don't use plagiarized sources. Get Your Custom Essay on
SAS Report about Analysis and Writing R Code
Just from $9/Page
Order Essay

The SAS code above is used for regression analysis of Weight and Height. Regression analysis is an analysis that tries to establish a relationship between a response or a dependent variable from a function of regressors or explanatory variables and parameters.The parameters are measured so that measure of fit is optimized, the equation used in this analysis is as follows:


Where Yi is the response variable, Xi is the regress variable, βo and β1 are unknown parameters to be estimated, and εi is the error term associated with the ith observation (Crawley 34-41). In this case, we are relating a child’s weight toa child’s height. In such a scenario, a simple linear regression model with response variable weight and the regressor variable height can be written as follows:

Wghti= βo1Heightii

The output of the above code is the default tabular output of the REG procedure for this model. Number of observations read=19, number of observation used is also 19: since there is no unobservable or missing value from the provided data.

Based on the parameter estimates by least-square estimates, the fitted regression line relationship between weight and height is described by the resulting equation
predicted Wght=-143.02692 + 3.89903 * Height.

At the least square solution, the residual sum of squares is:

SSE=∑i=119(Wghti – βo – β1 Height)2

The above is minimized and achieved value is displayed in the analysis of the variance table as the error sum of squares: 2142.48772

The fit plot below shows positive slope of fitted line. The average weight of a child varies by 3.89903 units for every unit change in height. The 1-α=95% confidence limits in the fit plot are point wise limits that cover the mean weight for a particular height with probability 0.95. The prediction limits, which are wider than the confidence limits, show the point wise limits that cover a new observation for a given height with probability 0.095. The statistic for the overall model is highly significant (=57.076, <0.0001), indicating that the model explains a significant portion of the variation in the data.

The degrees of freedom can be used in checking the accuracy of the data and model. The model degrees of freedom are one less than the number of parameters to be estimated (Dalgaard 11-24). This model estimates two parameters, βo and β1; thus, the degrees of freedom should be . The corrected total degrees of freedom are always one less than the total number of observations in the data set, in this case.

Several simple statistics follow the ANOVA table. The Root MSE is an estimate of the standard deviation of the error term. The coefficient of variation, or Coeff Var, is a unitless expression of the variation in the data. The R-square and Adj R-square are two statistics used in assessing the fit of the model; values close to 1 indicate a better fit. The R-square of 0.77 indicates that Height accounts for 77% of the variation in Weight




  1. R-code

>attach (DATA)

>lm (Wght~Height)

The function attach(DATA) attaches the data frame DATA so that it can be accessed in R. The argument lm is a model formula in which the tilde symbol (~) should be read as “described by.”

lm output:

  1. Estimated intercept α
  2. Estimated slope β

The best-fitting is a straight line seen to be;

Wght= slope(α) + Height(β)

The result of lm is a model object. To obtain more information on the linear model (lm), we proceed to write the following function in R,

>summary (lm(Wght~Height))

This gives a superficial view of the distribution of the residuals that may be used as a quick check of the distribution assumptions. The average of the residuals is zero by definition, so the median should not be far from zero, and the minimum and the maximum should roughly be equal in absolute value.

The regression coefficient and the intercept are accompanied by standard errors, t-test and the p-values (probability values). The symbols to the righty are graphical indicators of the level of significance.



-143.027        3.899



lm(formula = Wght ~ Height)


Min       1Q   Median       3Q      Max

-17.6807  -6.0642   0.5115   9.2846  18.3698



Estimate Std. Error t value Pr(>|t|)

(Intercept) -143.0269    32.2746 -4.432 0.000366 ***

Height         3.8990     0.5161   7.555 7.89e-07 ***  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1


Residual standard error: 11.23 on 17 degrees of freedom

Multiple R-squared:  0.7705,    Adjusted R-squared:  0.757

F-statistic: 57.08 on 1 and 17 DF,  p-value: 7.887e-07

>resid (lm.Wght)

1           2           3           4           5           6

-13.5061701   6.7317083 -13.5797581   0.6678176  -2.0615036   2.6124840

7           8           9          10          11          12

-5.6350916  11.8375266 -16.6624734  12.4841326  -6.4933343 -17.6807278

13          14          15          16          17          18

0.5115143  -4.2585944  12.2967391  18.3697570  14.7918904   3.8326780



>plot (Wght, Height, col=”red”)

> predict(lm.Wght)

1         2         3         4         5         6         7         8

126.00617  77.26829 111.57976 101.83218 104.56150  80.38752  90.13509 100.66247

9        10        11        12        13        14        15        16

100.66247  87.01587  56.99333 107.68073  76.48849 116.25859 137.70326 109.63024

17        18        19

118.20811  81.16732 116.25859


> predicted=predict (lm.Wght)


>plot (residuals, predicted)


            Works Cited

Crawley, Michael J. Statistics: An Introduction Using R. Hoboken: John Wiley & Sons, 2011.        Print.

Dalgaard, Peter. Introductory Statistics with R. New York: Springer, 2008. Print.

Get Professional Assignment Help Cheaply

Buy Custom Essay

Are you busy and do not have time to handle your assignment? Are you scared that your paper will not make the grade? Do you have responsibilities that may hinder you from turning in your assignment on time? Are you tired and can barely handle your assignment? Are your grades inconsistent?

Whichever your reason is, it is valid! You can get professional academic help from our service at affordable rates. We have a team of professional academic writers who can handle all your assignments.

Why Choose Our Academic Writing Service?

  • Plagiarism free papers
  • Timely delivery
  • Any deadline
  • Skilled, Experienced Native English Writers
  • Subject-relevant academic writer
  • Adherence to paper instructions
  • Ability to tackle bulk assignments
  • Reasonable prices
  • 24/7 Customer Support
  • Get superb grades consistently

Online Academic Help With Different Subjects


Students barely have time to read. We got you! Have your literature essay or book review written without having the hassle of reading the book. You can get your literature paper custom-written for you by our literature specialists.


Do you struggle with finance? No need to torture yourself if finance is not your cup of tea. You can order your finance paper from our academic writing service and get 100% original work from competent finance experts.

Computer science

Computer science is a tough subject. Fortunately, our computer science experts are up to the match. No need to stress and have sleepless nights. Our academic writers will tackle all your computer science assignments and deliver them on time. Let us handle all your python, java, ruby, JavaScript, php , C+ assignments!


While psychology may be an interesting subject, you may lack sufficient time to handle your assignments. Don’t despair; by using our academic writing service, you can be assured of perfect grades. Moreover, your grades will be consistent.


Engineering is quite a demanding subject. Students face a lot of pressure and barely have enough time to do what they love to do. Our academic writing service got you covered! Our engineering specialists follow the paper instructions and ensure timely delivery of the paper.


In the nursing course, you may have difficulties with literature reviews, annotated bibliographies, critical essays, and other assignments. Our nursing assignment writers will offer you professional nursing paper help at low prices.


Truth be told, sociology papers can be quite exhausting. Our academic writing service relieves you of fatigue, pressure, and stress. You can relax and have peace of mind as our academic writers handle your sociology assignment.


We take pride in having some of the best business writers in the industry. Our business writers have a lot of experience in the field. They are reliable, and you can be assured of a high-grade paper. They are able to handle business papers of any subject, length, deadline, and difficulty!


We boast of having some of the most experienced statistics experts in the industry. Our statistics experts have diverse skills, expertise, and knowledge to handle any kind of assignment. They have access to all kinds of software to get your assignment done.


Writing a law essay may prove to be an insurmountable obstacle, especially when you need to know the peculiarities of the legislative framework. Take advantage of our top-notch law specialists and get superb grades and 100% satisfaction.

What discipline/subjects do you deal in?

We have highlighted some of the most popular subjects we handle above. Those are just a tip of the iceberg. We deal in all academic disciplines since our writers are as diverse. They have been drawn from across all disciplines, and orders are assigned to those writers believed to be the best in the field. In a nutshell, there is no task we cannot handle; all you need to do is place your order with us. As long as your instructions are clear, just trust we shall deliver irrespective of the discipline.

Are your writers competent enough to handle my paper?

Our essay writers are graduates with bachelor's, masters, Ph.D., and doctorate degrees in various subjects. The minimum requirement to be an essay writer with our essay writing service is to have a college degree. All our academic writers have a minimum of two years of academic writing. We have a stringent recruitment process to ensure that we get only the most competent essay writers in the industry. We also ensure that the writers are handsomely compensated for their value. The majority of our writers are native English speakers. As such, the fluency of language and grammar is impeccable.

What if I don’t like the paper?

There is a very low likelihood that you won’t like the paper.

Reasons being:

  • When assigning your order, we match the paper’s discipline with the writer’s field/specialization. Since all our writers are graduates, we match the paper’s subject with the field the writer studied. For instance, if it’s a nursing paper, only a nursing graduate and writer will handle it. Furthermore, all our writers have academic writing experience and top-notch research skills.
  • We have a quality assurance that reviews the paper before it gets to you. As such, we ensure that you get a paper that meets the required standard and will most definitely make the grade.

In the event that you don’t like your paper:

  • The writer will revise the paper up to your pleasing. You have unlimited revisions. You simply need to highlight what specifically you don’t like about the paper, and the writer will make the amendments. The paper will be revised until you are satisfied. Revisions are free of charge
  • We will have a different writer write the paper from scratch.
  • Last resort, if the above does not work, we will refund your money.

Will the professor find out I didn’t write the paper myself?

Not at all. All papers are written from scratch. There is no way your tutor or instructor will realize that you did not write the paper yourself. In fact, we recommend using our assignment help services for consistent results.

What if the paper is plagiarized?

We check all papers for plagiarism before we submit them. We use powerful plagiarism checking software such as SafeAssign, LopesWrite, and Turnitin. We also upload the plagiarism report so that you can review it. We understand that plagiarism is academic suicide. We would not take the risk of submitting plagiarized work and jeopardize your academic journey. Furthermore, we do not sell or use prewritten papers, and each paper is written from scratch.

When will I get my paper?

You determine when you get the paper by setting the deadline when placing the order. All papers are delivered within the deadline. We are well aware that we operate in a time-sensitive industry. As such, we have laid out strategies to ensure that the client receives the paper on time and they never miss the deadline. We understand that papers that are submitted late have some points deducted. We do not want you to miss any points due to late submission. We work on beating deadlines by huge margins in order to ensure that you have ample time to review the paper before you submit it.

Will anyone find out that I used your services?

We have a privacy and confidentiality policy that guides our work. We NEVER share any customer information with third parties. Noone will ever know that you used our assignment help services. It’s only between you and us. We are bound by our policies to protect the customer’s identity and information. All your information, such as your names, phone number, email, order information, and so on, are protected. We have robust security systems that ensure that your data is protected. Hacking our systems is close to impossible, and it has never happened.

How our Assignment  Help Service Works

1.      Place an order

You fill all the paper instructions in the order form. Make sure you include all the helpful materials so that our academic writers can deliver the perfect paper. It will also help to eliminate unnecessary revisions.

2.      Pay for the order

Proceed to pay for the paper so that it can be assigned to one of our expert academic writers. The paper subject is matched with the writer’s area of specialization.

3.      Track the progress

You communicate with the writer and know about the progress of the paper. The client can ask the writer for drafts of the paper. The client can upload extra material and include additional instructions from the lecturer. Receive a paper.

4.      Download the paper

The paper is sent to your email and uploaded to your personal account. You also get a plagiarism report attached to your paper.

smile and order essaysmile and order essay PLACE THIS ORDER OR A SIMILAR ORDER WITH US TODAY AND GET A PERFECT SCORE!!!

order custom essay paper