title: Modelling data with a Weibull link function in R
body: <p>I am trying to model some data that follows a sigmoid curve relationship. In my field of work (psychophysics), a Weibull function is usually used to model such relationships, rather than probit.</p>
  
  <p>I am trying to create a model using R and am struggling with syntax. I know that I need to use the <code>vglm()</code> function from the <code>VGAM</code> package, but I am unable to get a sensible model out. Here's my data:</p>
  
  <pre><code># Data frame example data
  dframe1 &lt;- structure(list(independent_variable = c(0.3, 0.24, 0.23, 0.16, 
  0.14, 0.05, 0.01, -0.1, -0.2), dependent_variable = c(1, 1, 
  1, 0.95, 0.93, 0.65, 0.55, 0.5, 0.5)), .Names = c("independent_variable", 
  "dependent_variable"), class = "data.frame", row.names = c(NA, 
  -9L))
  </code></pre>
  
  <p>Here is a plot of the data in dframe1:</p>
  
  <pre><code>library(ggplot2)
  
  # Plot my original data
  ggplot(dframe1, aes(independent_variable, dependent_variable)) + geom_point()
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/UME1q.png" alt="enter image description here"></p>
  
  <p>This should be able to be modelled by a Weibull function, since the data fit a sigmoid curve relationship. Here is my attempt to model the data and generate a representative plot:</p>
  
  <pre><code>library(VGAM)
  
  # Generate model
  my_model &lt;- vglm(formula = dependent_variable ~ independent_variable, family = weibull, data = dframe1)
  
  # Create a new dataframe based on the model, so that it can be plotted
  model_dframe &lt;- data.frame(dframe1$independent_variable, fitted(my_model))
  
  # Plot my model fitted data
  ggplot(model_dframe, aes(dframe1.independent_variable, fitted.my_model.)) + geom_point()
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/dW6NF.png" alt="enter image description here"></p>
  
  <p>As you can see, this doesn't represent my original data at all. I'm either generating my model incorrectly, or I'm generating my plot of the model incorrectly. What am I doing wrong?</p>
  
  <p><strong>Note</strong>: I have edited this question to make it more understandable; previously I had been using the wrong function entirely (<code>weibreg()</code>). Hence, some of the comments below may not make sense.
  .....</p>