<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 This is an example of using Python and R together within a Jupyter notebook. First, let's generate some data within python.
Step1:  Now, we pass those two variables into R and perform linear regression, and get back the result.
Step2:  Now let's look at the contents of the variable that we got back (which should contain the parameter estimates)
<ASSISTANT_TASK:>
Python Code:
import numpy
%load_ext rpy2.ipython
x=numpy.random.randn(100)
beta=3
y=beta*x+numpy.random.randn(100)
Explanation: This is an example of using Python and R together within a Jupyter notebook. First, let's generate some data within python.
End of explanation
%%R -i x,y -o beta_est
result=lm(y~x)
beta_est=result$coefficients
summary(result)
Explanation: Now, we pass those two variables into R and perform linear regression, and get back the result.
End of explanation
print(beta_est)
Explanation: Now let's look at the contents of the variable that we got back (which should contain the parameter estimates)
End of explanation
<END_TASK>