R packages not installing

I kept getting error messages saying I can't install R packages.

I managed to solve this problem by directly downloading r packages on my PC and letting R-studio (or R) read the files directly.

To download a package  directly on your PC.  Go to

CRAN Packages By Date (r-project.org)

and find a package  you want.

For example, ... https://cran.r-project.org/web/packages/tidyverse/index.html

I downloaded  'r-release: tidyverse_2.0.0.zip. '

Run the following...         install.packages("C:/Users/..../Downloads/tidyverse_2.0.0.zip", repos = NULL, type = "win.binary")

FYI, this was what I was getting.

Warning in install.packages :
   リポジトリー http://repo.miserver.it.umich.edu/cran/src/contrib に対する索引にアクセスできません :
  cannot open URL 'http://repo.miserver.it.umich.edu/cran/src/contrib/PACKAGES'
Warning in install.packages :
  package ‘tidyverse’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
Warning in install.packages :
   リポジトリー http://repo.miserver.it.umich.edu/cran/bin/windows/contrib/4.3 に対する索引にアクセスできません :
  cannot open URL 'http://repo.miserver.it.umich.edu/cran
/bin/windows/contrib/4.3/PACKAGES'

Odds ratio in SAS PROC LOGISTIC

Odds ratio in SAS PROC LOGISTICS are just

exp(coefficient)

This is obvious for binary variables.

Even for continuous variables, it's just

exp(coefficient)

..which means that I think it is mot counterintuitive to standardize continuous variables.

So one easy way to get odds ratios is to run PROC LOGISTICS with continuous variables standardized and use exp(X) in Excel.

SAS Proc logistic and WWC effect size

ods trace on;
proc logistic data=final DESCENDING;
model YA01_3_bin =
treat
male
age_log
CH_compass
/*R_compass*/
white
black
/*other_race*/;
ods output ParameterEstimates=kaz1;
run;

data kaz1b;
set kaz1;
if Variable="Intercept" or Variable="treat";
keep Variable Estimate;
run;
proc transpose data=kaz1b out=kaz1bt;
id Variable;
run;

data kaz1bt2;
set kaz1bt;
C_LOGIT=intercept;
T_LOGIT=intercept+treat;
C_EXP=exp(C_LOGIT)/(1+exp(C_LOGIT));
C_ODDS=C_EXP/(1-C_EXP);
C_STEP1=log(C_ODDS);

T_EXP=exp(T_LOGIT)/(1+exp(T_LOGIT));
T_ODDS=T_EXP/(1-T_EXP);
T_STEP1=log(T_ODDS);

STEP2=T_STEP1-C_STEP1;
wwc_effect_size=STEP2/1.65;
odds_ratio=T_ODDS/C_ODDS;
run;

WWC effect size omega factor (to adjust for n) and R sample

https://ies.ed.gov/ncee/wwc/Docs/referenceresources/WWC_Procedures_Handbook_V4_1_Draft.pdf

See Page 16.

two_values<-view1b[3:4]
num<-view1b[2]

omega<-(1-3/(4*num-9))

C_LOGIT<-two_values[1]
C_EXP<-exp(C_LOGIT)/(1+exp(C_LOGIT))
C_ODDS<-C_EXP/(1-C_EXP)
C_STEP1<-log(C_ODDS)
T_LOGIT<-two_values[1]+two_values[2]
T_EXP<-exp(T_LOGIT)/(1+exp(T_LOGIT))
T_ODDS<-T_EXP/(1-T_EXP)
T_STEP1<-log(T_ODDS)
STEP2<-T_STEP1-C_STEP1
wwc_effect_size<-STEP2/1.65

wwc_effect_size_omega<-(omega*STEP2)/1.65

odds_ratio<-T_ODDS/C_ODDS

 

SAS data variable function detepart

if datepart(OffenseDate) > s_date;

 

 

data crim;
set abc.crim_history;
format new_date MMDDYY10.;
format s_date MMDDYY10.;
new_date=datepart(OffenseDate);
s_date=mdy(1,1,2019);
instruction="Drop ";
if new_date > s_date then instruction="Keep";
*if datepart(OffenseDate) > s_date;
run;

#clear console
rm(list = ls())

setwd("C:/sas/(01) D/newdata")

crim<- read_excel("HistoryCombined.xlsx",sheet="History ")

#Creating the new dataset after WV review -- I added dual credit info per grade level
write.foreign(crim, "C:/sas/(01) D/newdata/data.txt",
"C:/sas/(01) D/newdata/data.sas", package="SAS")

 

Packages I use are:

library(broom)
library(compute.es)
library(dplyr)
library(forcats)
library(FSA)
library(gapminder)
library(ggplot2)
library(gmodels)
library(haven)
library(here)
library(leaflet)
library(magrittr)
library(markdown)
library(MatchIt)
library(plyr)
library(psych)
library(purrr)
library(readr)
library(readxl)
library(sas7bdat)
library(sf)
library(sqldf)
library(stringr)
library(summarytools)
library(tidyverse)
library(tmap)
library(tmaptools)
library(descr)
library(MatchIt)
library(sjmisc)
library(writexl)
library(skimr)
library(lme4)
library(lmerTest)
library(car)
library(foreign)