To calculate standardized regression coefficient in R, first you need to scale data using **scale()** function and then calculate linear regression using **lm()** function.

The following method shows how you can do it with syntax.

**Method 1: Use scale() and lm() Function**

```
scaled_data <- scale(data)
lm(scaled_data)
```

The following example shows how to calculate regression coefficient in R.

## Using scale() and lm() Function

Let’s see how we can calculate standard regression coefficient in R for dataframe:

```
# Create data frame
df <- data.frame(Machine_name=c("A","B","C","D","E","F","G","H"),
Pressure=c(12.39,11.25,12.15,13.48,13.78,12.89,12.21,12.58),
Temperature=c(78,89,85,84,81,79,77,85),
Status=c(1,1,0,1,0,0,1,0))
# Standardized each column and fit regression model
model_std <- lm(scale(Status) ~ scale(Pressure) + scale(Temperature), data=df)
# Turn off scientific notation
options(scipen=999)
# Print model summary
summary(model_std)
```

Output:

```
Call:
lm(formula = scale(Status) ~ scale(Pressure) + scale(Temperature),
data = df)
Residuals:
1 2 3 4 5 6 7 8
0.6089 0.5745 -1.0267 1.4966 -0.3706 -0.9454 0.4618 -0.7990
attr(,"scaled:center")
[1] 0.5
attr(,"scaled:scale")
[1] 0.5345
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.0000000000000001103 0.3833337991214945673 0.000 1.000
scale(Pressure) -0.4232585044554402209 0.4388721238096346955 -0.964 0.379
scale(Temperature) -0.2156345776725547281 0.4388721238096346955 -0.491 0.644
Residual standard error: 1.084 on 5 degrees of freedom
Multiple R-squared: 0.1603, Adjusted R-squared: -0.1756
F-statistic: 0.4773 on 2 and 5 DF, p-value: 0.6461
```

Here in the above code we standardized each column and fit regression model.Then we turn off scientific notations and show the model summary.