Pairwise corelation Plot in R [closed] - r

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I have dataframe In R wanted to plot pairwise corelation plot currently using package "PerformanceAnalytics" but I am not able get nice colored graph any one suggest me a nice package i tried "psych" not able install to my system. is there any way i can plot
below mention my data
test1 test2 test3 test4 test4 test5 test6 test7
1.4367 1.6589 2.0227 2.2793 159.91 144 18910.1 19137.1902803603
0.2403 0.3404 0.9538 1.1041 226.1 317.61 6275.68 12618.0982994217
0.1737 0.2882 0.8039 3.1088 372.12 177.59 7912.73 6529.72939693551
library("PerformanceAnalytics")
chart.Correlation(df, histogram=TRUE, pch=19)
output
how I wanted a nice colured plot like below any one suggest me how can I plot

Related

Species Distribution modelling incorporating climate data in R [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I am trying to use data from GBIF to get an idea of Vachellia species disturbution across Africa and overlay this with annual rainfall in R.
Any package advice, online resources or tutorials would be greatly appreciated?
Thanks in advance
Not easy to see what you have in mind, but you may try
Chloropleth: sf, rnaturalearth, ggplot (geom_sf), maps
Openstreetmap: ggmap (get_stamenmap(bbox = bbox, zoom = 5, maptype = "toner-lite"))
Spatial smoothing: mgcv (gam_gp = target ~ te(lat, long, m = list(c(3,.5)), d=2, bs = 'gp'), data = data_dt, cluster=cl, method = "REML")
Spatial regression
Other packages may be useful as well, on the top of my mind: leaflet, tmap, gganimate
see:
using spatial data in R
Geocomputaion with R
Species distribution modelling
R-spatial
Nice example of spatial smoothing with GAMs
Have fun

Nonlinear LAD regression in R [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I would like to estimate the parameters of a nonlinear regression model with LAD regression. In essence the LAD estimator is an M-estimator. As far as I know it is not possible to use the robustbase package to do this. How could I use R to do LAD regression? Could I use a standard package?
You could do this with the built-in optim() function
Make up some data (make sure x is positive, so that a*x^b makes sense - raising negative numbers to fractional powers is problematic):
set.seed(101)
a <- 1; b <- 2
dd <- data.frame(x=rnorm(1000,mean=7))
dd$y <- a*dd$x^b + rnorm(1000,mean=0,sd=0.1)
Define objective function:
objfun <- function(p) {
pred <- p[1]*dd$x^p[2] ## a*x^b
sum(abs(pred-dd$y)) ## least-absolute-deviation criterion
}
Test objective function:
objfun(c(0,0))
objfun(c(-1,-1))
objfun(c(1,2))
Optimize:
o1 <- optim(fn=objfun, par=c(0,0), hessian=TRUE)
You do need to specify starting values, and deal with any numerical/computational issues yourself ...
I'm not sure I know how to compute standard errors: you can use sqrt(diag(solve(o1$hessian))), but I don't know if the standard theory on which this is based still applies ...

predicting the index number based on spiral data [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Each co-ordinate(x,y) corresponds to an index. For example: (0,0) has index 0 AND (1,0) has index 1 .
X <-c(0,1,1,0,-1,-1,-1,0,1,2,2,2,2,1,0,-1,-2)
Y <- c(0,0,1,1,1,0,-1,-1,-1,-1,0,1,2,2,2,2,2)
Z<- as.factor(0:16)
df <- data.frame(X,Y,Z)
library(e1071)
model <- svm(Z ~ X+Y, xyz, kernel = "radial")
predict(model, xyz[1:4,1:2]) #1.647681 3.859354 5.908940 4.151374
# From the last code, it appears that it does not predict well for its own data
i need help in building a predictive model which can predict the index.
What is the index corresponding to (12,-22) ?

Can you perform a Kernel Logistic Regression in R [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I am trying to perform a Kernel Logistic Regression in R. Is there a package that does this?
stats::ksmooth gives you the Nadaraya–Watson kernel regression:
with(cars, {
plot(speed, dist>40)
lines(ksmooth(speed, dist>40, "normal", bandwidth = 2), col = 2)
lines(ksmooth(speed, dist>40, "normal", bandwidth = 6), col = 3)
})

Phylogenetic MANOVA in R? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Does anyone know of a package or method in R of carrying out a MANOVA whilst controlling for phylogenetic non-independence?
Thank you!
sos package is your friend:
library('sos')
findFn('phylogenetic MANOVA')
seems like geiger package and more precisely aov.phylo performs phylogenetic ANOVA or MANOVA.
Here an example from the help :
library(geiger)
geo=get(data(geospiza))
dat=geo$dat
d1=dat[,1]
grp<-as.factor(c(rep(0, 7), rep(1, 6)))
names(grp)=rownames(dat)
## MANOVA
x=aov.phylo(dat~grp, geo$phy, nsim=50, test="Wilks")
Multivariate Analysis of Variance Table
Response: dat
Df Wilks approx-F num-Df den-Df Pr(>F) Pr(phy)
group 1 0.27872 3.6229 5 7 0.061584 0.549
Residuals 11

Resources