diagnostics {remstimate}R Documentation

Compute the diagnostics of a remstimate object

Description

A function that returns the diagnostics of a remstimate object. The output object of the method diagnostics contains the residuals of the model estimated in the remstimate object, and the event rates estimated from the model at each tiem point. For tie-oriented modeling frameworks the object contains: a list residuals with two objects, standardized_residuals containing standardized Schoenfeld's residuals (Schoenfeld, D., 1982, <doi:10.2307/2335876>; Grambsch, P. M., & Therneau, T. M., 1994, <doi:10.2307/2337123>; Winnett, A., & Sasieni, P., 2001, <jstor.org/stable/2673500>), and smoothing_weights (a matrix of weights used for the red smooth splines in the plot of the residuals), an array structure rates with the event rates estimated from the optimized model parameters, and .reh.processed which is a pseudo-hidden object containing a further processed remify object that helps speed up the plotting function plot.remstimate and that the user is not supposed to modify. As to the actor-oriented modeling frameworks, in the diagnostics output there are two main list objects named after sender_model and receiver_model. After selecting the model, the structure of diagnostics is the same as for the tie-oriented model. Each model's diagnostics (sender or receiver) is available only if the corresponding model is found in the remstimate object.

Usage

diagnostics(object, reh, stats, ...)

## S3 method for class 'remstimate'
diagnostics(object, reh, stats, ...)

Arguments

object

is a remstimate object.

reh

is a remify object, the same used for the 'remstimate' object.

stats

is a remstats object, the same used for the 'remstimate' object.

...

further arguments to be passed to the 'diagnostics' method.

Value

a object of class "diagnostics" "remstimate" with standardized Schoenfeld's residuals and estimated event rates given the optimized model parameters.

Methods (by class)

Examples


# ------------------------------------ #
#       tie-oriented model: "MLE"      #
# ------------------------------------ #

# loading data
data(tie_data)

# processing event sequence with remify
tie_reh <- remify::remify(edgelist = tie_data$edgelist, model = "tie")
  
# specifying linear predictor
tie_model <- ~ 1 + 
               remstats::indegreeSender()+
               remstats::inertia()+
               remstats::reciprocity() 

# calculating statistics
tie_reh_stats <- remstats::remstats(reh = tie_reh, 
                                    tie_effects = tie_model)

# running estimation
tie_mle <- remstimate::remstimate(reh = tie_reh,
                                  stats = tie_reh_stats,
                                  method = "MLE",
                                  ncores = 1)

# diagnostics
tie_diagnostics <- diagnostics(object = tie_mle, reh = tie_reh, stats = tie_reh_stats)
names(tie_diagnostics)


[Package remstimate version 2.3.11 Index]