title: Predict using multiple variables in R
body: <p>I have a slight problem with my R coursework. </p>
  
  <p>I have made a following dataset:</p>
  
  <p><img src="https://i.stack.imgur.com/yBCfo.png" alt="Dataset"></p>
  
  <p>Now I'm going to plot the values based on this dataset using the following command:  </p>
  
  <pre><code>plot(x ~ Group.1, data = jarelmaks_vaikelaen23mean, 
      xlab = "Vanus", ylab = "PD", main = "Järelmaks ja väikelaen")
  </code></pre>
  
  <p>After that, I'm creating a glm model using the following command. The difference is, that now I'm using an original dataset (the values of the dependent values are 1/0).</p>
  
  <p><img src="https://i.stack.imgur.com/L3QeW.png" alt="The original dataset">  </p>
  
  <p>GLM command:  </p>
  
  <pre><code>jarelmaks_vaikelaen23_mudel &lt;- glm(Default ~ Vanus.aastates + Toode, 
      family = binomial(link = 'logit'), data = jarelmaks_vaikelaen_23)
  </code></pre>
  
  <p>Now, I'm trying to predict the values using my model. </p>
  
  <pre><code>predict(jarelmaks_vaikelaen23_mudel,data.frame(Vanus.aastates=x),type = "resp")
  </code></pre>
  
  <p>Unfortunately, I get a following error message:  </p>
  
  <pre><code>Error in data.frame(Vanus.aastates = x) : object 'x' not found
  </code></pre>
  
  <p>Can you give me some ideas, how to solve this problem or explain, how this predict() command works or smth? </p>