Residuals against fitted values show pattern [closed] - r

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I am going to fit a model using linear and quadratic model.
If the graphs of residuals against fitted values show pattern(not random pattern),what is the cause and how can i fix it?

This should be a comment, but I have insufficient rep for that.
The cause of the pattern is that your model doesn't account for something.
The fix is to find what that is, and include it in your model.

Related

My object is defined but doesn't exist. How to solve the problem? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
I defined several dummy variables and I can see them in my dataset. However, when I try to run a regression model, R says that Error: object "my_variable" not found. I also used exists(my_variable) and got the same error message. I checked for the spelling and it was not a problem.
I'd appreciate it if someone can help.
First, when you use exists(), you should put the variable in quotations (i.e., exists("my_variable")).
Second, be sure that you set up your regression model properly. For example:
lm(response ~ predictor1 + predictor2 + predictor3 + ...,
data=my_variable)
Ultimately, you need to include some of your data via dput(head(my_variable)), and the regression code.

Standard Deviation in R [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I am trying to calculate the standard deviation from scratch in R (I do know R has a build-in function for that), but I'm not getting the correct results, so I don't know what I'm doing wrong.
My.SD<-function(X) {
M<-(sum(X)/length(X))
my.var<-sum((X-M)^2)
StanDev<-sqrt(my.var/length(X))
print(StanDev)
}
I guess you might need to use (length(X)-1) rather than length(x), i.e.,
My.SD<-function(X) {
M<-(sum(X)/length(X))
my.var<-sum((X-M)^2)
StanDev<-sqrt(my.var/(length(X)-1))
print(StanDev)
}
since here it should be sample standard deviation.

Easy Function to plot equation of abline [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I am beginner in R and i have a simple regression. Now i want to plot the equation of the regression line into the plot. The most easiest way. I already tried to get it done by following some ideas here.
DICE_Quartal<-read.csv("")
attach(DICE_Quartal)
plot(Preise.Fernbusmarkt ~ Auskunftpflichtige.Unternehmen) + abline(cor_preis_unternehmen, col = "red")

Error in sort.list(y): 'x' must be atomic for sort list [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I am trying to use c50 here what I did
train$default<-as.factor(train$default)
result<-C5.0(train[-17],train$default)
finalresult <- predict(result, test)
I am trying to run the following command table(test, Predicted=finalresult)in the R soft
but it is giving the following error
Error in sort.list(y): 'x' must be atomic for sort list
any suggestions?
You did not state how test looks. Since it is used for a prediction it presumably contains features and the value you want to predict. Assuming test$answer is what you want to predict. Try
table(test$answer, Predicted=finalresult)

How can a SE be above 1000 in a multilevel logistic regression? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
Maybe my question will fail to be specific but when fitting a glme model (using lme4 package in R) I get for one of the parameters SE=1000, with the estimated parameter as high as 16. The variable is a dichotomous variable. My question is if there might be an explanation for such a result, considering that the other parameters have parameters and SE that seem ok
That's a sign that you have complete separation. You should re-run the model without that covariate. Since its an ME model you may need to do a tabulation of outcome by covariate by levels to see what is happening. More details would allow greater specificity in our answers.
This is a link to a posting by Jarrod Hadfield, one of the guRus on the R mixed model mailing list. It demonstrates how complete separation leads to the Hauck-Donner effect, and it offers some further approaches to attempt dealing with it.
You may be seeing a case of the Hauck-Donner effect. Here is one post that discusses it, you can read the original paper or search the web for additional discussions.

Resources