0% found this document useful (0 votes)
7 views1 page

Linear Regression Analysis in R

The document contains R code for analyzing the relationship between weight (peso) and systolic blood pressure (sistolica). It includes creating a linear model, plotting the data, and fitting a model without an intercept. Additionally, it shows how to read data from a CSV file and manipulate it within R.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Linear Regression Analysis in R

The document contains R code for analyzing the relationship between weight (peso) and systolic blood pressure (sistolica). It includes creating a linear model, plotting the data, and fitting a model without an intercept. Additionally, it shows how to read data from a CSV file and manipulate it within R.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

peso<-c(75, 76, 82, 70, 96, 80, 86, 95, 91, 68, 72, 77, 77, 78, 72,

76, 79, 83, 98, 89, 82, 65, 109, 107,


87,85)

sistolica<-c(130, 133, 150, 128, 151, 146, 150, 140, 148, 125, 133, 135, 150, 153, 128, 132, 149,
158, 150, 163, 156, 124, 170, 165, 160, 159)

plot(peso,sistolica)

SP<-lm(sistolica~peso)

summary(SP)

abline(SP$coeff)

SPsinbeta0<-glm(sistolica~ -1 + peso)

summary(SPsinbeta0)

plot(peso,sistolica,pch=2)

abline(SP$coeff)

points(peso,SPsinbeta0$fitt)

cambiar la direccion del archive: file, change dir...

getwd()

> sistolica<-[Link]("[Link]",header=TRUE,sep=";")

> edit(sistolica)

>names(sistolica)

>plot(sistolica)

You might also like