Question: Probit Regression modelling in R

0

krushnach80 •

**580**wrote:I have already made a post in stack, wont; make a duplicate here, so Im giving the link here probit modelling question

I would be really glad if I get input about it since im not sure if im doing it correctly or not ..

`so df is my original data frame so ,im making d2 to change my sample into factors`

```
conc<- c(6 , 5, 4,3,2,1,0,-1,-2)
IMRS <- c(1,1,0.23,1,1,0.8,0.4,0.5,0.0)
S18S <- c(1,1,.69,1,1,0.33,0.4,0.0,0.0)
df <- data.frame(conc,IMRS,S18S)
head(df)
conc IMRS S18S
1 6 1.00 1.00
2 5 1.00 1.00
3 4 0.23 0.69
4 3 1.00 1.00
5 2 1.00 1.00
6 1 0.80 0.33
library(tidyr)
d2=gather(df,SAMPLE,y,IMRS,S18S,factor_key=T)
head(d2)
conc SAMPLE y
1 6 IMRS 1.00
2 5 IMRS 1.00
3 4 IMRS 0.23
4 3 IMRS 1.00
5 2 IMRS 1.00
6 1 IMRS 0.80
glm.out=glm(SAMPLE~conc+y,d2,family = binomial(link = "probit"))
summary(glm.out)
library(ggplot2)
lr_data <- data.frame(predictor=glm.out$linear.predictors,
prob=glm.out$fitted.values, SAMPLE=d2$SAMPLE)
ggplot(lr_data, aes(x=predictor, y=prob, color=SAMPLE)) + geom_point(size=10)+
geom_line(linetype = "dashed",lwd = 0.5)+geom_hline(yintercept = 0.65)
```

Build a model that predicts the level of your dependent variable (x) based on concentration (y)

So am i doing it in opposite manner ? or it wont matter .let me know

```
"Predict values from the model using predict()"
```

Can you plug that into my code how do i use or do that? because I been through the tutorials im not sure/cofident about using the

```
predict()
```

Hi Krushnach, there is not enough information provided - perhaps not even you is sure of the experiment? It is also confusing (looking at the post on StackExchange) because you produce an object called

`df`

and then one called`d2`

. From where did you obtain the figure that you posted?The standard procedure would be:

`predict()`

49kupdated my question with code..the figure i got from a paper where they did this probit analysis

580Okay, can you share the paper? I am interested to see it

49khi kevin I don;t have acess to that figure i followed your procedure and I get something similar to that

Since i took the example from stack I wanted to ask what is the equivalent of this

`plogis`

for probit ?580Whoever up-voted @Kevin's comment above should consider the following.

Upvoting posts/comments is meant to be used in cases where the content of the post/comment contributes to solving original question/adds useful information. Upvoting "can you share the paper?" above does not help anyone and is a misuse of the voting system.

72kokay im sorry i hit it, my apology now i reversed it

580