Комментарии:
How do i merge two datasets A and B but data set B is a small data that has to go and replace certain cells in A
ОтветитьVery clear and succinct. All the info I needed clearly explained. 👍🏾
ОтветитьYESSSSS THANK YOUUUUU
ОтветитьThank you for the good lesson; explained very clearly.
ОтветитьDirectly answered what I was looking for - Thank you!
I have used 'drop_na()' as oppose to 'na.omit()' for the most part, but always good to know alternative ways of doing things.
hi, i'm trying to do cov. with two groups of values, but one has NAs and R doesn't allow me to remove themwhan i do the cov, and if i rewrite the two groups without NA they are different in lenght, so cov can't be done, what i can do? ;(
ОтветитьHow to deal with the missing data for catergory variable, please?
Ответитьand how do i do if it only shows other characters but not "NA", sir?
Ответитьgood stuff
ОтветитьHello i have a question!
Should you always remove missing values in dataset (especially for public data)? Or do we need to consider the proportion of missing data, missing value type (MCAR, MAR, NMAR), and skewness of the data?
I’m really struggled with this particular issue (not the technique, but the judgement as to remove missing values or not), Please shed me a light and thanks!
na.omit is removing the whole row. what if I do not remove the whole row? Is there any way I can plot geom_line without omitting na? The plot needs to ignore the point where there is a na?
ОтветитьTabulated value and calculated value in t-test normal distribution by plot in R programming
ОтветитьR programming for t-test two tail tabulated value in plot
ОтветитьThank you so much! You have been such a good help.
ОтветитьExcellent work
ОтветитьWhat if I had two entries for each SUBJECT and I want to filter both of their entries if one of their entries in another collumn is NA? ps: great video as always!
ОтветитьHow to Undefined In place of NA?
ОтветитьThank you very much!
ОтветитьI am trying to use ggscatter but I have many NAs in y column and no correlation coefficient appears. Is there any way of ignoring these NAs or changing them to "0"? please help me, thank you.
Ответитьhello, great videos thanks! question, if I wanted to get the NA values in a separate subset instead of omitting or removing them, what can I do?
ОтветитьI have been following your tutorials for a couple of days now. I want to say thank you, they are truly direct and straight to the point. I wish that you would offer consultation to students even if you decide to charge a price on it. Because sometimes one might get stuck and not know what to do.
ОтветитьKönntest du das auch noch mal in Deutsch aufnehmen? :D
ОтветитьThe problem is that depending on the package na.rm does not work. It seems that each package has its own way to consider NAs. This is stressful when you are used to SAS.
ОтветитьThanks for this video
Ответитьplease help me in this .....my result saying argument y missing with no defualt
library(MASS)
library(maxLik)
library(matrixcalc)
mu1=2 ;mu2=2;sig1=1;sig2=1;sai=mu1-mu2;mu=c(mu1,mu2)
sigma=matrix(c(sig1,0,0,sig2),2,2,byrow=TRUE)
n=10;nr=mvrnorm(n,mu,sigma)
t1=sum(nr[1]);t2=sum(nr[2]);t3=sum((nr[1])^2);t4=sum((nr[2])^2)
t5=sum(nr[1]*nr[2]) ;c0=-t1-t2-n*log(2*3.14)
negl= function(x,y,z,w){
term1= (t3-2*(y+x)*t1+n*(x+y)^2)/(2*z)
term2=(t4-2*y*t2+n*y^2)/(2*w)
negl1= -c0 + (n/2)*log(z) + (n/2)*log(w) + term1 + term2
return(negl1)
}
v1=c(0,2,3,1)
maxBFGS(negl, grad=NULL, hess=NULL, start=v1, fixed=NULL,control=NULL,constraints=NULL,finalHessian=TRUE,parscale=rep(1, length=length(start)))
I like all your Video
Ответить# LOAD LIBRARIES
library(quantmod)
library(xts)
# FUNCTIONS
# ROLLING BETA
pcbeta = function(dF){
r = prcomp( ~ dF$x[-1] + dF$y[-1])
return(r$rotation[2, 1] / r$rotation[1,1])
}
rolling_beta = function(z, width){
rollapply(z, width = width, FUN = pcbeta,
by.column = FALSE, align = 'right')
}
# GET TICKER DATA
SPY = getSymbols('SPY', adjust=T, auto.assign=FALSE)
AAPL = getSymbols('AAPL', adjust=T, auto.assign=FALSE)
# IN-SAMPLE DATE RANGE
in_start_date = '2011-01-01'
in_end_date = '2011-12-31'
in_range = paste(in_start_date, '::', in_end_date, sep='')
# RETRIEVE IN-SAMPLE DATA
x_in = SPY[in_range, 6]
y_in = AAPL[in_range, 6]
dF_in = cbind(x_in, y_in)
names(dF_in) = c('x','y')
# OUT-OF-SAMPLE DATE RANGE
out_start_date= '2012-01-01'
out_end_date = '2012-12-31'
out_range = paste(out_start_date, '::', out_end_date, sep='')
# RETRIEVE OUT-OF-SAMPLE DATA
x_out = SPY[out_range, 6]
y_out = AAPL[out_range, 6]
dF_out = cbind(x_out, y_out)
names(dF_out) = c('x', 'y')
# CALCULATE RETURNS (IN AND OUT OF SAMPLE)
returns_in = diff(dF_in) / dF_in
returns_out = diff(dF_out) / dF_out
# DEFINE ROLLING WINDOW LENGTH
window_length = 10
# FIND BETAS
betas_in = rolling_beta(returns_in, window_length)
betas_out = rolling_beta(returns_out, window_length)
# FIND SPREADS
spreadR_in = returns_in$y - betas_in * returns_in$x
spreadR_out = returns_out$y - betas_out * returns_out$x
names(spreadR_in) = c('spread')
names(spreadR_out) = c('spread')
# FIND THRESHOLD
threshold = sd(spreadR_in, na.rm=TRUE)
plot(data$spread, main = "AAPL vs. SPY In-Sample", cex.main = 0.8, cex.lab = 0.8, cex.axis = 0.8)
abline(h = threshold, lty = 2)
abline(h = -threshold, lty = 2)
abline function not work why?
Hello,
How do handle NaN in R?
Sir, in your statisticsglobe website, where do we start? As a beginner to R, I'd like to know as to where to start. Thanks
ОтветитьHow does this work the other way round? For example, I want all values in my dataframe to become NA if they are below 0.4. Thank you!
ОтветитьYour videos are amazing and easy to understand! Thank you!!!
Ответитьexcellent joachim, perfectly explained
ОтветитьLove it, thank you one more time dude! Love the way you prepared your lessons ´cause they are really short, focus on an specific context and finally you gave us multiple solutions for an scenario, so thats the way it must be.
ОтветитьInformative and well explained
Ответитьhow do you handle or replace NA values in a dataset where dates and other numeric information is missing .
Ответить @Statistics Globe Vielen Dank für das tolle Video. Das hat wirklich geholfen :) Leider habe ich immer noch ein Problem, und ich hoffe wirklch sehr, dass du meine Frage beantworten kannst. An welche Stelle setzte ich das na.rm = TRUE in einem komplexeren Code?
Ich bekomme immer eine Fehlermeldung und ich schätze (laut Internetrecherche) dass diese etwas mit den NA zu tun hat: Fehler in KhatriRao(sm, t(mm)) : (p <- ncol(X)) == ncol(Y) is not TRUE.
Doch wenn ich na.rm = TRUE verwende, behauptet R dies sei ein unbenutztes Argument. Ich vermute ich habe es an die falsche Stelle geschrieben.
Das ist mein Code:
fit2 <- lme4::lmer(stroop$rt ~ 1 + stroop$trialnum + (1 + stroop$trialnum|stroop$pno), data = stroop)
LG, Paula
(Der Datensatz hat über 26000 Zeilen und über 2600 NAs)
Hi can I ask a question please
ОтветитьCan you just remove NA's from a specific column within a data set? For example, if I have a column such as "wind chill" which has a lot of blanks when its not cold outside, I don't want to erase all of that data from the data set if I am looking at another column/vector of interest. Thanks!
ОтветитьHow can You make a new data frame that excludes all the NA values
Ответитьhow about if I only want to remove rows with all values are NA?
Ответитьwhen you ran na.omit(airquality) before mean(airquality$ozone) already rows with NAs were deleted, giving you a complete numeric dataset, then why mean(airquality$ozone) is returning NA again....
ОтветитьThanks. Very helpful
ОтветитьThanks you,tutorial was very helpful
ОтветитьTHank you very much for this video (Just subscribed). How do you remove 'NA" from a data set that has no numeric values. Say I just had to Columns( Name and Hair Color) and some of the Hair colors were NA.. how would I omit that?
ОтветитьAfter omitting the NA the nos of rows still show the numbers in the original data set . Though I see that the number of row in the data after committing the rows is 111. which code can I use to get this 111 as nrow() gives me the original numbers
ОтветитьHow can I delete a certain row only if the amount of NA's surpasses a certain threshold? E.g. when I have like 100 slope coefficients, but only one value is missing, it sounds a bit harsh to delete the whole row. How can I tell R to only delete the row, if there's let's say more than 10 NA's?
Ответитьthank you so much ❤❤❤
ОтветитьThank you so much for the well-explained video. Keep on posting them please. You are doing a great job!
ОтветитьThanks for this video.
Ответить