package ‘Zelig’ is not available for R version 3.6.3 - r

I want to use the Zelig package to get the ATT (Average treatment effect on treated) and ATE (Average treatment effect) after performing PSM (propensity score matching) using Nearest-neighbor matching method.
After going through all the related issues I found that Zelig has no compatibility with R version 3.6.3.
I would like to ask if there is any possible way to run the above package on macOS Catalina 10.15.4 and R: version 3.6.3.
If not, Is there any other way to get the ATT and ATE after performing PSM matching using MatchIt/Match. I would really appreciate a way out.
Thanks in advance.

Zelig has been removed from CRAN. See
https://cran.r-project.org/web/packages/Zelig/index.html
On the archive page, the last version appears to have been 5.1.6. You can get it using
remotes::install_version("Zelig", "5.1.6")

Related

missing functions in spatstat library (such as Kest, and rpoint)

i'm trying to use the Kest function (and many other in the spatstat package).
i have made a ppp point pattern data set (ppp.1)
summary (ppp.1)
Planar point pattern: 189 points
Average intensity 241122300 points per square unit
Coordinates are given to 6 decimal places
Window: rectangle = [40.74603, 40.74662] x [-111.84693, -111.8456] units
(0.000592 x 0.001324 units)
Window area = 7.83834e-07 square units
when i try to use the Kest function: Kest(ppp.1), i get the following error:
Error in Kest(ppp.1) : could not find function "Kest"
in fact, there are many functions in the spatstat package that can't be found (e.g., rpoint)... i get the same error.
does this have anything to do with "spatstat.random" not being found when i load the spatstat library:
Error: package ‘spatstat.random’ required by ‘spatstat’ could not be found
i'm using the most current version of R and spatstat (on an intel Mac):
R version 4.2.1 (2022-06-23) -- "Funny-Looking Kid"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin17.0 (64-bit)
spatstat 2.3-4 downloaded installed directly from R.
thank you.
Some time ago spatstat was one big package containing all the functions you mention, but due to technical requirements from CRAN it has now been split into several smaller packages all named according to the scheme spatstat.xxxx such as spatstat.random. The package spatstat is now an umbrella package with barely any functions, but it depends on spatstat.random and others, and it loads all these packages when you execute library(spatstat) in the R console.
Under normal circumstances R should refuse to install spatstat without all the needed sub-packages, but it appears you have an installation of spatstat without e.g. spatstat.random. Probably the easiest solution is to remove spatstat and install it again:
remove.packages("spatstat")
install.packages("spatstat", dependencies = TRUE)
Alternatively you can try (requires a relatively new version of spatstat to already be installed):
pkgs <- spatstat::spatstat.family()
install.packages(pkgs)
To find information about a package, you can visit its CRAN page (go to cran.r-project.org and look for Contributed Packages).
The CRAN page for spatstat says that spatstat 2.3-4 requires the packages spatstat.random and spatstat.core. This means that spatstat depends on code that is provided in these other packages.
Your error message says that spatstat.random is missing. This explains why the random generation function rpoint was not found.
As #EgeRubak says, the best solution is to remove and re-install spatstat.

Unable to replicate sample_n results using constant seed across R versions

I'm trying to replicate the sampling results from a script made in early January 2021. At the time, I forgot to record the R version and dplyr version I was using to create the sample. Now I have reinstalled R with the newest version of R (4.1.1) and dplyr (1.0.7) but I can't replicate my sampling results. I know that earlier R versions might use different RNGs, so I've tried to use RNGversion() to try out my seed with all versions of R but to no avail. This is not entirely surprising because I recall having used at least R 3.6.0, after which there shouldn't have been changes to the default RNG.
rm(list=ls())
library(dplyr)
RNGversion("3.5.0")
set.seed(182508)
Are there any other factors besides the R version that could affect my randomization results? For example, changes in the dplyr function sample_n? I know that sample_n has been superseded by slice_sample, but sample_n is still usable in the newest version of dplyr.

Arch modeling Python

I have been using Python to fit an ARCH model to monthly return series of Intel stock from 1989-2010. I have used the ARCH library written by Kevin Shepphard. Now, when cross checking with R, my coefficients of Volatilty model is slightly different than what R tells me it is. I am wondering, why is there so many differences in results across packages? Which language is correct then? R's fGarch package or Kevin shepphards package? The problem is the p values across the two languages are completely different. I'm confused which language to use to get the correct results. I have attached the link to my work below. If you scroll down, you will be able to see my Python implementation where I'm trying to fit a arch(3) model and likewise Rs implementation. If someone can please explain where the difference is coming from and which package to trust, I would highly appreciate it
Thanks
http://nbviewer.ipython.org/gist/mrajancsr/96a19065794c8c0bd850
Fixed in 95ccc3e on August 6, 2015
https://github.com/bashtage/arch/commit/95ccc3e94d408d92c6d0d8635a62ff2a26243f45

Determining the previous version of r that produced an older R data file

So I had run some mixed models on an older version, an unknown version of R. These models had converged, however, I recently updated R to 3.1.1, and now these models don't converge.
I would like potentially revert back to the previous (yet unknown) version of R, and re-run the models to check and make sure that they actually converged on that version.
The specific question I have is:
Is there a way to determine the previous version that produced the results that are saved in a given data file? If so, how?
Alternatively, I do know that the data file was produced on the last version that I had installed, so if I can somehow figure out which version that was that would suffice. I should note that it's unlikely that the last version that I installed corresponds to the last version offered.
Any help would be appreciated.

Bivariate Poisson Regression in R?

I found a package 'bivpois' for R which evaluates a model for two related poisson processes (for example, the number of goals by the home and the away team in a soccer game). However, this package seems to no longer be useable in newer versions of R.
Is there a reasonable way to modify the glm() function to do a similar process, or run this older package on my new version of R? I have found very little literature on these sorts of processes and have found very little in terms of easy implementation in other statistical packages like STATA.
Any suggestions would be much appreciated.
While CRAN does not host a current binary of bivpois, you can build the package from the archived source code (see http://cran.r-project.org/doc/manuals/R-exts.html#Checking-and-building-packages ). Building bivpois 0.50-3.1 from source (available at http://cran.r-project.org/src/contrib/Archive/bivpois/) works for me on R 2.15.0 Windows x64. The zipped Windows binary I built is available here: http://commondatastorage.googleapis.com/jthetzel-public/bivpois_0.50-3.1.zip .
You can feel free to refer to odds modelling and testing inefficiency of sports-bookmakersas I had modified the relevant functions inside bivpois package.

Resources