Category "r"

How to plot coefficients with robust standard errors?

I have this LSDV model using the "lm()" function and adding the country dummy variables minus the intercept. Then I made robust standard errors in order to fix

Average a multiple number of rows for every column, multiple times

Here I have a snippet of my dataset. The rows indicate different days of the year. The Substations represent individuals, there are over 500 individuals. The 1

plotting means in a horizontal bar with a vertical line

ID score1 score 2 score 3 score 4 1 200 300 400 -200 2 250 -310 -470 -200 3 210 400 480 -200 4 220 -10 -400 -200 5 150 -50 400 -200 I am new to R, I want to m

plotting means in a horizontal bar with a vertical line

ID score1 score 2 score 3 score 4 1 200 300 400 -200 2 250 -310 -470 -200 3 210 400 480 -200 4 220 -10 -400 -200 5 150 -50 400 -200 I am new to R, I want to m

Efficient implementation of value selection based on a column

R> data.frame(x1=1:3, x2=11:13, y=c('a', 'a;b', 'b')) x1 x2 y 1 1 11 a 2 2 12 a;b 3 3 13 b I have a data.frame in the format like above, where if

Trying to run a moderation analysis in R with multiple variables, but getting an error message

I'm trying to run setCor(Relconflict ~ dif * ï..ORG * Nation * LrelQ, data = Data2, zero = FALSE, std = FALSE, use = "complete") while trying to run a mode

How to add the same hyperlink to the value in a table in shinnyapp?

I have the below UI and server for my data. I would like to have the value in the number column as a hyperlink, then by clicking can go through the website. I w

row_sums vs findFreqTerms for subsetting TermDocMatrix to include words with a given min frequency

my question is straightforward. I have a (binary) TDM and I want to reduce the number of rows to include only those rows that appear in at least two documents:

Error in switch(tolower(device), ragg_png = , png = paste0(files, ".png"), : EXPR must be a length 1 vector

I am very new to R, so apologies if I don't make any sense. I am trying to make a flexdashboard for a class project and wanted to create an animated graph. The

Error in iiwgee: aeqSurv exception, an interval has effective length 0

I am using iiwgee function to fit survival model. I got this error when I fitting my model: Error in aeqSurv(Y) : aeqSurv exception, an interval has effectiv

Using character vectors from two different data frames as formula in regression with lm function

Currently i have two data frames that would look something like this: df1 <- as.data.frame(rbind(c("Name1", "Name2"), c("Name2", "Name3"), c("Name4", "Name5"

"grouping factor must have exactly 2 levels"

Hi y'all I'm fairly new to R and I'm supposed to calculate F statistic for this table The code I have inputted is as follows: # F-test res.ftest <- var.test

Rstudio Installation on Ubuntu App windows 11 I get Black screen

I installed Rstudio from terminal of Ubuntu App of windows 11 (Windows subsystem for linux) R version is R version 4.2.0 (2022-04-22) R studio after installatio

Plotly multiple updatemenus

Building on this post, I am trying to create two updatemenus in R plotly that would allow to select every possible combination of two factors. This is what I ha

inconsistent date format. Fixing it using is.na() and creating a new column with a unified format

heres what happens after I do bdata$Period <- as.Date(cdata$Period,"%Y-%m-%d") bdata So how do I convert the dates that are still in character format usin

Incorporating external regressor in a hierarchical/ grouped time series

Fellow contributors, I have been working with a hierarchical time series, relating to a set of identical products in a number of stores. For this purpose when w

Apply condition to opposite of regex pattern

How could I apply this regex so that all data in the column that does not match this regex turns to 'Need' - Currently, if I run this, it applies Need to all th

How to interpret the fixed effects in relation to random effects in mixed effects model?

This is a small subset of my data to show what it looks like because my data set is too large: I want to compare the long-term effect of two t

Filling NA data with data from another row with matching

Here is example data: df = data.frame(id = (1:5), type= c("a_type","a_type","b_type","b_type", "c_type"), start_date= lubridate:

How can I plot time series data?

My df dataset is like this. I want to plot the yield of sugarcane, coconut and rice in time. I filter the data by rice,sugarcane and coconut. My code is this: